LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::PersistMetaData()
bool MetaStor::PersistMetaData() {
    if (!PersistIndexToDevice()) {
        __WARN("Persist Index failed.");
        return false;
    }

    if (!PersistSSTsToDevice()) {
        __WARN("Persist SSTs failed.");
        return false;
    }

    if (!persistSuperBlockToDevice()) {
        __WARN("Persist SB failed.");
        return false;
    }

    return true;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x359f0
testb $0x1, %al
jne 0x358c6
jmp 0x3584e
movq 0x3b783(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x8480
movq 0x18(%rsp), %rdi
movq %rax, %rdx
leaq 0x1d48c(%rip), %rsi     # 0x52cfd
leaq 0x1db18(%rip), %rcx     # 0x53390
leaq 0x1d9ce(%rip), %r8      # 0x5324d
movl $0xcb, %r9d
movb $0x0, %al
callq 0x86f0
movq 0x3b745(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x1db03(%rip), %rsi     # 0x533a0
movb $0x0, %al
callq 0x86f0
movq 0x3b72d(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x1d510(%rip), %rsi     # 0x52dc5
movb $0x0, %al
callq 0x86f0
movb $0x0, 0x37(%rsp)
jmp 0x359d8
movq 0x20(%rsp), %rdi
callq 0x35c40
testb $0x1, %al
jne 0x3594e
jmp 0x358d6
movq 0x3b6fb(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x8480
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x1d404(%rip), %rsi     # 0x52cfd
leaq 0x1da90(%rip), %rcx     # 0x53390
leaq 0x1d946(%rip), %r8      # 0x5324d
movl $0xd0, %r9d
movb $0x0, %al
callq 0x86f0
movq 0x3b6bd(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x1da91(%rip), %rsi     # 0x533b6
movb $0x0, %al
callq 0x86f0
movq 0x3b6a5(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x1d488(%rip), %rsi     # 0x52dc5
movb $0x0, %al
callq 0x86f0
movb $0x0, 0x37(%rsp)
jmp 0x359d8
movq 0x20(%rsp), %rdi
callq 0x35f40
testb $0x1, %al
jne 0x359d3
jmp 0x3595e
movq 0x3b673(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x8480
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x1d37c(%rip), %rsi     # 0x52cfd
leaq 0x1da08(%rip), %rcx     # 0x53390
leaq 0x1d8be(%rip), %r8      # 0x5324d
movl $0xd5, %r9d
movb $0x0, %al
callq 0x86f0
movq 0x3b635(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x1da1e(%rip), %rsi     # 0x533cb
movb $0x0, %al
callq 0x86f0
movq 0x3b61d(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x1d400(%rip), %rsi     # 0x52dc5
movb $0x0, %al
callq 0x86f0
movb $0x0, 0x37(%rsp)
jmp 0x359d8
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Migrate.cc
// Function: hlkvds::Migrate::ForeMigrate(unsigned int)
uint32_t Migrate::ForeMigrate(uint32_t mt_vol_id) {
    std::lock_guard <std::mutex> lck(mtx_);

    //Get the sorted Segments
    Volume *ft_vol = ft_->GetVolume();

    //check free segment;
    uint32_t free_seg_num = ft_vol->GetTotalFreeSegs();
    if (free_seg_num > SEG_RESERVED_FOR_GC) {
        __DEBUG("some thread already called Do Migrate, ignore this call!");
        return 0;
    }

    uint32_t max_seg_num = ft_vol->GetNumberOfSeg();
    free_seg_num = doMigrate(mt_vol_id, max_seg_num);
    return free_seg_num;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movl %esi, 0x54(%rsp)
movq 0x58(%rsp), %rsi
movq %rsi, 0x18(%rsp)
addq $0x20, %rsi
leaq 0x48(%rsp), %rdi
callq 0xb5f0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x37250
movq %rax, 0x20(%rsp)
jmp 0x36389
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x510f0
movl %eax, 0x14(%rsp)
jmp 0x363a3
movl 0x14(%rsp), %eax
movl %eax, 0x30(%rsp)
cmpl $0x2, 0x30(%rsp)
jbe 0x363de
movl $0x0, 0x64(%rsp)
movl $0x1, 0x2c(%rsp)
jmp 0x36426
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xb830
jmp 0x36439
movq 0x40(%rsp), %rdi
callq 0x16d50
movl %eax, 0x10(%rsp)
jmp 0x363ee
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x54(%rsp), %esi
movl 0x28(%rsp), %edx
callq 0x36450
movl %eax, 0xc(%rsp)
jmp 0x3640e
movl 0xc(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x64(%rsp)
movl $0x1, 0x2c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xb830
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x8820
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Migrate.cc
// Function: hlkvds::Migrate::loadKvList(unsigned int, std::__cxx11::list<hlkvds::KVSlice*, std::allocator<hlkvds::KVSlice*>>&)
bool Migrate::loadKvList(uint32_t seg_id, std::list<KVSlice*> &slice_list) {

    uint64_t seg_phy_off;

    Volume *ft_vol = ft_->GetVolume();
    ft_vol->CalcSegOffsetFromId(seg_id, seg_phy_off);

    memset(ftDataBuf_, 0 , ftSegSize_);
    if (!ft_vol->Read(ftDataBuf_, ftSegSize_, seg_phy_off)) {
        return false;
    }

    SegHeaderOnDisk seg_header;
    memcpy(&seg_header, ftDataBuf_, SegBase::SizeOfSegOnDisk());

    uint32_t num_keys = seg_header.number_keys;

    loadSegKV(slice_list, num_keys, seg_phy_off);
    return true;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movl %esi, 0x64(%rsp)
movq %rdx, 0x58(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movq (%rax), %rdi
callq 0x37250
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
movl 0x64(%rsp), %esi
leaq 0x50(%rsp), %rdx
callq 0x23960
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
movl 0x50(%rax), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x8280
movq 0x10(%rsp), %rax
movq 0x48(%rsp), %rdi
movq 0x48(%rax), %rsi
movl 0x50(%rax), %eax
movl %eax, %edx
movq 0x50(%rsp), %rcx
callq 0x50ed0
testb $0x1, %al
jne 0x36bec
movb $0x0, 0x77(%rsp)
jmp 0x36c6f
leaq 0x28(%rsp), %rdi
callq 0x40a80
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, (%rsp)
callq 0x166a0
movq %rax, 0x8(%rsp)
jmp 0x36c0f
movq 0x8(%rsp), %rdx
movq (%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x8410
movq 0x10(%rsp), %rdi
movl 0x44(%rsp), %eax
movl %eax, 0x18(%rsp)
movq 0x58(%rsp), %rsi
movl 0x18(%rsp), %edx
movq 0x50(%rsp), %rcx
callq 0x36d50
jmp 0x36c44
movb $0x1, 0x77(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x40ac0
jmp 0x36c6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x40ac0
jmp 0x36c7a
movb 0x77(%rsp), %al
andb $0x1, %al
addq $0x78, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8820
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/ReadCache.cc
// Function: dslab::ReadCache::Get(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 ReadCache::Get(string key, string &value){
	ReadLock r_lock(myLock);
	map<string, string>::iterator it_dedup = dedup_map.find(key);
	if( it_dedup!=dedup_map.end() ){
		return cache_map->Get(it_dedup->second, value);
	}
	else{ 
		value = "";
		return false;
	}
}

// Assembly:
subq $0xa8, %rsp
movq %rsi, 0x20(%rsp)
movq %rdi, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq 0x98(%rsp), %rsi
movq %rsi, 0x18(%rsp)
addq $0x70, %rsi
leaq 0x78(%rsp), %rdi
callq 0x38c50
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x8, %rdi
callq 0x388e0
movq %rax, 0x28(%rsp)
jmp 0x381e9
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movq %rax, 0x70(%rsp)
addq $0x8, %rdi
callq 0x38950
movq %rax, 0x58(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x38930
testb $0x1, %al
jne 0x3821e
jmp 0x382b4
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x38980
movq %rax, %rsi
addq $0x20, %rsi
leaq 0x38(%rsp), %rdi
callq 0x81a0
jmp 0x38248
movq 0x10(%rsp), %rdi
movq 0x88(%rsp), %rdx
movq (%rdi), %rax
movq 0x18(%rax), %rax
leaq 0x38(%rsp), %rsi
callq *%rax
movb %al, 0xf(%rsp)
jmp 0x38269
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0xa7(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x8928
movl $0x1, 0x34(%rsp)
jmp 0x382da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x382f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x8928
jmp 0x382f5
movq 0x88(%rsp), %rdi
leaq 0x1ab03(%rip), %rsi     # 0x52dc6
callq 0x8670
jmp 0x382ca
movb $0x0, 0xa7(%rsp)
movl $0x1, 0x34(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x38c80
movb 0xa7(%rsp), %al
andb $0x1, %al
addq $0xa8, %rsp
retq
leaq 0x78(%rsp), %rdi
callq 0x38c80
movq 0x68(%rsp), %rdi
callq 0x8820
nopl (%rax)
// File: yangwanyuan[P]HLKVDS/./src/include/CacheMap.h
// Function: dslab::CacheMap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::create(dslab::CachePolicy, unsigned long, unsigned long)
CacheMap<K, D> *CacheMap<K, D>::create(CachePolicy policy, size_t cache_size, size_t probation){
	if(policy == LRU){
		return new LRUMap<K, D> (cache_size);
	}else{
		size_t protect = cache_size-probation;
		return new SLRUMap<K, D> (protect, probation);
	} 
}

// Assembly:
subq $0x48, %rsp
movl %edi, 0x3c(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0x387c0
movl $0x70, %edi
callq 0x84f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rsi
callq 0x39bf0
jmp 0x3879a
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x3881b
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x84b0
jmp 0x38825
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x10(%rsp)
movl $0xe8, %edi
callq 0x84f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x39e20
jmp 0x387f7
movq (%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x3881b
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x84b0
jmp 0x38825
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8820
nop
// 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>>>::LRUMap(unsigned long)
LRUMap(size_t size){
        if(size <= 0)
            size = 1024;

        entries = new Node<K,D>[size];
        for(size_t i = 0; i < size; ++i)
            free_entries.push_back(entries + i);

        head = new Node<K,D>;
        tail = new Node<K,D>;
        head->prev = NULL;
        head->next = tail;
        tail->prev = head;
        tail->next = NULL;

    }

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x39ec0
movq 0x48(%rsp), %rdi
leaq 0x36d16(%rip), %rax     # 0x70938
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, 0x40(%rsp)
callq 0x39ee0
movq 0x48(%rsp), %rdi
addq $0x40, %rdi
movq %rdi, 0x50(%rsp)
callq 0x39ef0
cmpq $0x0, 0x78(%rsp)
ja 0x39c5b
movq $0x400, 0x78(%rsp)      # imm = 0x400
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movl $0x50, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testb %cl, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, 0x38(%rsp)
jmp 0x39c94
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x28(%rsp)
cmpq $0x0, %rax
je 0x39cf5
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x39f00
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0x39cce
movq 0x48(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x68(%rax)
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x78(%rsp), %rax
jae 0x39d8c
movq 0x48(%rsp), %rax
movq %rax, %rdi
addq $0x40, %rdi
movq 0x68(%rax), %rax
movq 0x60(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rsi
callq 0x39f30
jmp 0x39d49
jmp 0x39d4b
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x39d0c
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
callq 0x39f60
movq 0x40(%rsp), %rdi
callq 0x39fc0
movq 0x48(%rsp), %rdi
callq 0x3a450
jmp 0x39e13
movl $0x50, %edi
callq 0x84f0
movq %rax, 0x8(%rsp)
jmp 0x39d9d
movq 0x8(%rsp), %rdi
callq 0x39f00
movq 0x8(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x58(%rax)
movl $0x50, %edi
callq 0x84f0
movq %rax, (%rsp)
jmp 0x39dc5
movq (%rsp), %rdi
callq 0x39f00
movq (%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x58(%rax), %rcx
movq $0x0, 0x40(%rcx)
movq 0x60(%rax), %rdx
movq 0x58(%rax), %rcx
movq %rdx, 0x48(%rcx)
movq 0x58(%rax), %rdx
movq 0x60(%rax), %rcx
movq %rdx, 0x40(%rcx)
movq 0x60(%rax), %rax
movq $0x0, 0x48(%rax)
addq $0x88, %rsp
retq
movq 0x70(%rsp), %rdi
callq 0x8820
nopl (%rax)
// 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>>>::Get(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 LRUMap<K,D>::Get(K key, D& data){
    Node<K,D> *node = cached_map[key];
    if(node){
        detach(node);
        attach(node);
        data = node->data;
	return true;
    }
    else{
        data = D();
	return false;
    }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x8, %rdi
callq 0x3b4b0
movq (%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x3a38e
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x3b4e0
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x3b520
movq 0x30(%rsp), %rsi
addq $0x20, %rsi
movq 0x38(%rsp), %rdi
callq 0x8060
movb $0x1, 0x57(%rsp)
jmp 0x3a3b6
leaq 0x10(%rsp), %rdi
callq 0x86a0
movq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x85d0
leaq 0x10(%rsp), %rdi
callq 0x8928
movb $0x0, 0x57(%rsp)
movb 0x57(%rsp), %al
andb $0x1, %al
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// 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>>>::Delete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool LRUMap<K,D>::Delete(K key){
    Node<K,D> *node = cached_map[key];
    if(node){
        detach(node);
	free_entries.push_back(node);
	cached_map.erase(node->key);
	return true;
    }
    else{
	return false;
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
addq $0x8, %rdi
callq 0x3b4b0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x3a439
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x3b4e0
movq (%rsp), %rdi
addq $0x40, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3cb90
movq (%rsp), %rdi
addq $0x8, %rdi
movq 0x8(%rsp), %rsi
callq 0x3b5c0
movb $0x1, 0x27(%rsp)
jmp 0x3a43e
movb $0x0, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopl (%rax)
// 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>>>::attach(dslab::Node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*)
void attach(Node<K,D>* node){
        node->prev = head;
        node->next = head->next;
        head->next = node;
        node->next->prev = node;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq 0x58(%rax), %rdx
movq -0x10(%rsp), %rcx
movq %rdx, 0x40(%rcx)
movq 0x58(%rax), %rcx
movq 0x48(%rcx), %rdx
movq -0x10(%rsp), %rcx
movq %rdx, 0x48(%rcx)
movq -0x10(%rsp), %rcx
movq 0x58(%rax), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %rcx, 0x40(%rax)
retq
nopl (%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegHeaderOnDisk::SegHeaderOnDisk(hlkvds::SegHeaderOnDisk const&)
SegHeaderOnDisk::SegHeaderOnDisk(const SegHeaderOnDisk& toBeCopied) {
    timestamp = toBeCopied.timestamp;
    trx_id = toBeCopied.trx_id;
    trx_segs = toBeCopied.trx_segs;
    checksum_data = toBeCopied.checksum_data;
    checksum_length = toBeCopied.checksum_length;
    number_keys = toBeCopied.number_keys;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq -0x10(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rsp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rsp), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rsp), %rcx
movl 0x1c(%rcx), %ecx
movl %ecx, 0x1c(%rax)
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::KVSlice::~KVSlice()
KVSlice::~KVSlice() {
    if (deepCopy_) {
        delete[] key_;
        delete[] data_;
    }
    if (digest_) {
        delete digest_;
    }
    if (entry_) {
        delete entry_;
    }
    if (entryGC_) {
        delete entryGC_;
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x28(%rsp)
testb $0x1, 0x34(%rax)
je 0x40c96
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x40c76
movq 0x20(%rsp), %rdi
callq 0x8610
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x40c94
movq 0x18(%rsp), %rdi
callq 0x8610
jmp 0x40c96
movq 0x28(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x40ccc
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x40cca
movq 0x10(%rsp), %rdi
callq 0x29d50
movq 0x10(%rsp), %rdi
callq 0x84b0
jmp 0x40ccc
movq 0x28(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x40d02
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x40d00
movq 0x8(%rsp), %rdi
callq 0x253b0
movq 0x8(%rsp), %rdi
callq 0x84b0
jmp 0x40d02
movq 0x28(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x40d35
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x40d33
movq (%rsp), %rdi
callq 0x253b0
movq (%rsp), %rdi
callq 0x84b0
jmp 0x40d35
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::KVSlice::copy_helper(hlkvds::KVSlice const&)
void KVSlice::copy_helper(const KVSlice& toBeCopied) {
    keyLength_ = toBeCopied.GetKeyLen();
    dataLength_ = toBeCopied.GetDataLen();
    key_ = toBeCopied.GetKey();
    data_ = toBeCopied.GetData();
    *digest_ = *toBeCopied.digest_;
    *entry_ = *toBeCopied.entry_;
    segId_ = toBeCopied.segId_;
    deepCopy_ = toBeCopied.deepCopy_;
    *entryGC_ = *toBeCopied.entryGC_;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
callq 0x44260
movw %ax, %cx
movq (%rsp), %rax
movzwl %cx, %ecx
movl %ecx, 0x8(%rax)
movq 0x8(%rsp), %rdi
callq 0x163a0
movw %ax, %cx
movq (%rsp), %rax
movw %cx, 0x18(%rax)
movq 0x8(%rsp), %rdi
callq 0x23a30
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rdi
callq 0x23a40
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rsi
movq 0x20(%rax), %rdi
callq 0x29d60
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq 0x28(%rcx), %rsi
movq 0x28(%rax), %rdi
callq 0x25500
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movl 0x30(%rcx), %ecx
movl %ecx, 0x30(%rax)
movq 0x8(%rsp), %rcx
movb 0x34(%rcx), %cl
andb $0x1, %cl
movb %cl, 0x34(%rax)
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rsi
movq 0x38(%rax), %rdi
callq 0x25500
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::KVSlice::KVSlice(char const*, int, char const*, int, bool)
KVSlice::KVSlice(const char* key, int key_len, const char* data, int data_len, bool deep_copy) :
    key_(NULL), keyLength_(key_len), data_(NULL), dataLength_(data_len),
            digest_(NULL), entry_(NULL), segId_(0), deepCopy_(deep_copy),
            entryGC_(NULL) {
    if (deepCopy_) {
        key_ = new char[key_len];
        data_ = new char[data_len];
        memcpy((void*)key_, key, key_len);
        memcpy((void*)data_, data, data_len);
    } else {
        key_ = key;
        data_ = data;
    }
    calcDigest();
}

// Assembly:
subq $0x38, %rsp
movb %r9b, %al
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq %rcx, 0x18(%rsp)
movl %r8d, 0x14(%rsp)
andb $0x1, %al
movb %al, 0x13(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, (%rax)
movl 0x24(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl 0x14(%rsp), %ecx
movw %cx, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movl $0x0, 0x30(%rax)
movb 0x13(%rsp), %cl
andb $0x1, %cl
movb %cl, 0x34(%rax)
movq $0x0, 0x38(%rax)
testb $0x1, 0x34(%rax)
je 0x40fa1
movslq 0x24(%rsp), %rdi
movq $-0x1, %rax
cmpq $0x0, %rdi
cmovlq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movslq 0x14(%rsp), %rdi
movq $-0x1, %rax
cmpq $0x0, %rdi
cmovlq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq (%rax), %rdi
movq 0x28(%rsp), %rsi
movslq 0x24(%rsp), %rdx
callq 0x8410
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rsp), %rsi
movslq 0x14(%rsp), %rdx
callq 0x8410
jmp 0x40fb7
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rdi
callq 0x40fd0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::KVSlice::calcDigest()
void KVSlice::calcDigest() {
    if (digest_) {
        delete digest_;
        digest_=nullptr;
    }
    digest_ = new Kvdb_Digest();
    Kvdb_Key vkey(key_, keyLength_);
    KeyDigestHandle::CalcDigest(&vkey, *digest_);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rax)
je 0x4101f
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x41012
movq 0x18(%rsp), %rdi
callq 0x29d50
movq 0x18(%rsp), %rdi
callq 0x84b0
movq 0x20(%rsp), %rax
movq $0x0, 0x20(%rax)
movl $0x14, %edi
callq 0x84f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
callq 0x29ce0
jmp 0x4103b
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq (%rax), %rsi
movl 0x8(%rax), %edx
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x29c80
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rdi
movq 0x20(%rax), %rsi
callq 0x29e70
jmp 0x41073
leaq 0x28(%rsp), %rdi
callq 0x29c70
addq $0x48, %rsp
retq
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
callq 0x84b0
jmp 0x410b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x29c70
movq 0x38(%rsp), %rdi
callq 0x8820
nop
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::KVSlice::SetKeyValue(char const*, int, char const*, int)
void KVSlice::SetKeyValue(const char* key, int key_len, const char* data,
                          int data_len) {
    keyLength_ = key_len;
    dataLength_ = data_len;
    key_ = key;
    data_ = data;

    calcDigest();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq %rcx, 0x8(%rsp)
movl %r8d, 0x4(%rsp)
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %eax
movl %eax, 0x8(%rdi)
movl 0x4(%rsp), %eax
movw %ax, 0x18(%rdi)
movq 0x18(%rsp), %rax
movq %rax, (%rdi)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rdi)
callq 0x40fd0
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::Request::operator=(hlkvds::Request const&)
Request& Request::operator=(const Request& toBeCopied) {
    done_ = toBeCopied.done_;
    stat_ = toBeCopied.stat_;
    slice_ = toBeCopied.slice_;
    segPtr_ = toBeCopied.segPtr_;
    return *this;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq -0x10(%rsp), %rcx
movb (%rcx), %cl
andb $0x1, %cl
movb %cl, (%rax)
movq -0x10(%rsp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movq 0x68(%rcx), %rcx
movq %rcx, 0x68(%rax)
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegBase::copyHelper(hlkvds::SegBase const&)
void SegBase::copyHelper(const SegBase& toBeCopied) {
    segId_ = toBeCopied.segId_;
    vol_ = toBeCopied.vol_;
    segSize_ = toBeCopied.segSize_;
    headPos_ = toBeCopied.headPos_;
    tailPos_ = toBeCopied.tailPos_;
    keyNum_ = toBeCopied.keyNum_;
    keyAlignedNum_ = toBeCopied.keyAlignedNum_;
    memcpy(dataBuf_, toBeCopied.dataBuf_, segSize_);
    sliceList_ = toBeCopied.sliceList_;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq 0x8(%rsp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0x14(%rax)
movq 0x8(%rsp), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq 0x8(%rsp), %rcx
movl 0x1c(%rcx), %ecx
movl %ecx, 0x1c(%rax)
movq 0x8(%rsp), %rcx
movl 0x20(%rcx), %ecx
movl %ecx, 0x20(%rax)
movq 0x40(%rax), %rdi
movq 0x8(%rsp), %rcx
movq 0x40(%rcx), %rsi
movslq 0x10(%rax), %rdx
callq 0x8410
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
addq $0x28, %rsi
addq $0x28, %rdi
callq 0x44270
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegBase::Put(hlkvds::KVSlice*)
void SegBase::Put(KVSlice* slice) {
    if (slice->IsAlignedData()) {
        headPos_ += IndexManager::SizeOfDataHeader() + slice->GetKeyLen();
        tailPos_ -= ALIGNED_SIZE;
        keyAlignedNum_++;
    } else {
        headPos_ += IndexManager::SizeOfDataHeader() + slice->GetKeyLen() + slice->GetDataLen();
    }
    keyNum_++;
    sliceList_.push_back(slice);
    __DEBUG("Put request key = %s", slice->GetKeyStr().c_str());
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
callq 0x442d0
testb $0x1, %al
jne 0x41988
jmp 0x419cf
callq 0x238d0
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
callq 0x44260
movq 0x18(%rsp), %rdx
movw %ax, %cx
movq 0x20(%rsp), %rax
movzwl %cx, %ecx
addq %rcx, %rdx
movl 0x14(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x14(%rax)
movl 0x18(%rax), %ecx
subl $0x1000, %ecx           # imm = 0x1000
movl %ecx, 0x18(%rax)
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
jmp 0x41a1c
callq 0x238d0
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x44260
movw %ax, %cx
movq 0x8(%rsp), %rax
movzwl %cx, %ecx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
callq 0x163a0
movq 0x10(%rsp), %rdx
movw %ax, %cx
movq 0x20(%rsp), %rax
movzwl %cx, %ecx
addq %rcx, %rdx
movl 0x14(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x14(%rax)
movq 0x20(%rsp), %rdi
movl 0x1c(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rdi)
addq $0x28, %rdi
leaq 0x28(%rsp), %rsi
callq 0x235f0
addq $0x38, %rsp
retq
nopl (%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegBase::TryPutList(std::__cxx11::list<hlkvds::KVSlice*, std::allocator<hlkvds::KVSlice*>>&)
bool SegBase::TryPutList(std::list<KVSlice*> &slice_list) {
    uint32_t freeSize = tailPos_ - headPos_;
    uint32_t needSize = 0;
    for (list<KVSlice *>::iterator iter = slice_list.begin(); iter != slice_list.end(); iter++) {
        KVSlice *slice = *iter;
        needSize += slice->GetDataLen() + slice->GetKeyLen() + IndexManager::SizeOfDataHeader();
    }
    return freeSize > needSize;

}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rcx
movl 0x18(%rcx), %eax
subl 0x14(%rcx), %eax
movl %eax, 0x34(%rsp)
movl $0x0, 0x30(%rsp)
movq 0x38(%rsp), %rdi
callq 0x16410
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rdi
callq 0x16460
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x16440
testb $0x1, %al
jne 0x41a98
jmp 0x41b06
leaq 0x28(%rsp), %rdi
callq 0x16490
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x163a0
movzwl %ax, %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdi
callq 0x44260
movw %ax, %cx
movl 0x4(%rsp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
cltq
movq %rax, 0x8(%rsp)
callq 0x238d0
movq 0x8(%rsp), %rcx
addq %rax, %rcx
movl 0x30(%rsp), %eax
addq %rcx, %rax
movl %eax, 0x30(%rsp)
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x164c0
movq %rax, 0x10(%rsp)
jmp 0x41a74
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
seta %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegBase::WriteSegToDevice()
bool SegBase::WriteSegToDevice() {
    if (segId_ < 0)
    {
        __ERROR("Not set seg_id to segment");
        return false;
    }
    fillEntryToSlice();
    __DEBUG("Begin write seg, free size %u, seg id: %d, key num: %d", tailPos_-headPos_ , segId_, keyNum_);
    return _writeDataToDevice();
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpl $0x0, (%rax)
jge 0x41c3f
jmp 0x41bca
movq 0x2f407(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x8480
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x108c4(%rip), %rsi     # 0x524b1
leaq 0x1259b(%rip), %rcx     # 0x5418f
leaq 0x125a5(%rip), %r8      # 0x541a0
movl $0x115, %r9d            # imm = 0x115
movb $0x0, %al
callq 0x86f0
movq 0x2f3c9(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x12596(%rip), %rsi     # 0x541af
movb $0x0, %al
callq 0x86f0
movq 0x2f3b1(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x11194(%rip), %rsi     # 0x52dc5
movb $0x0, %al
callq 0x86f0
movb $0x0, 0x27(%rsp)
jmp 0x41c59
movq 0x10(%rsp), %rdi
callq 0x41c70
movq 0x10(%rsp), %rdi
callq 0x422e0
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegBase::_writeDataToDevice()
bool SegBase::_writeDataToDevice() {
    posix_memalign((void **)&dataBuf_, 4096, segSize_);

    copyToDataBuf();
    uint64_t offset = 0;
    vol_->CalcSegOffsetFromId(segId_, offset);

    bool ret = vol_->Write(dataBuf_, segSize_, offset);

    free(dataBuf_);
    dataBuf_ = NULL;

    return ret;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rax, %rdi
addq $0x40, %rdi
movslq 0x10(%rax), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x8230
movq 0x8(%rsp), %rdi
callq 0x42380
movq 0x8(%rsp), %rax
movq $0x0, 0x18(%rsp)
movq 0x8(%rax), %rdi
movl (%rax), %esi
leaq 0x18(%rsp), %rdx
callq 0x23960
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x40(%rax), %rsi
movslq 0x10(%rax), %rdx
movq 0x18(%rsp), %rcx
callq 0x50fa0
movb %al, %cl
movq 0x8(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x17(%rsp)
movq 0x40(%rax), %rdi
callq 0x85b0
movq 0x8(%rsp), %rax
movq $0x0, 0x40(%rax)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::operator=(hlkvds::SegForReq const&)
SegForReq& SegForReq::operator=(const SegForReq& toBeCopied) {
    if (this == &toBeCopied) {
        return *this;
    }

    SegBase::operator=(toBeCopied);
    idxMgr_ = toBeCopied.idxMgr_;
    timeout_ = toBeCopied.timeout_;
    startTime_ = toBeCopied.startTime_;
    persistTime_ = toBeCopied.persistTime_;
    isCompletion_ = toBeCopied.isCompletion_;
    hasReq_ = toBeCopied.hasReq_;
    reqCommited_.store(toBeCopied.reqCommited_.load());
    reqList_ = toBeCopied.reqList_;
    delReqList_ = toBeCopied.delReqList_;
    return *this;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq 0x30(%rsp), %rax
jne 0x4292e
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x42af1
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x41830
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x48(%rdi)
movq 0x30(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x50(%rdi)
movq 0x30(%rsp), %rsi
addq $0x58, %rsi
addq $0x58, %rdi
callq 0x50780
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x68, %rsi
addq $0x68, %rdi
callq 0x50780
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movb 0x78(%rcx), %cl
andb $0x1, %cl
movb %cl, 0x78(%rax)
movq 0x30(%rsp), %rcx
movb 0x79(%rcx), %cl
andb $0x1, %cl
movb %cl, 0x79(%rax)
addq $0x7c, %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rsp), %rax
addq $0x7c, %rax
movq %rax, 0x70(%rsp)
movl $0x5, 0x6c(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x6c(%rsp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x194f0
movl %eax, 0x24(%rsp)
jmp 0x429e1
movl 0x24(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0xc(%rsp)
decl %eax
subl $0x2, %eax
jb 0x42a12
jmp 0x429fa
movl 0xc(%rsp), %eax
subl $0x5, %eax
je 0x42a1f
jmp 0x42a05
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x64(%rsp)
jmp 0x42a34
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x64(%rsp)
jmp 0x42a34
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x64(%rsp)
jmp 0x42a34
movq %rax, %rdi
callq 0xa6a0
movq 0x10(%rsp), %rcx
movl 0x64(%rsp), %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
movl $0x5, 0x50(%rsp)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
movl 0x50(%rsp), %edi
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x194f0
movl %eax, 0x4c(%rsp)
movl 0x50(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x54(%rsp), %ecx
movl %ecx, 0x48(%rsp)
subl $0x3, %eax
je 0x42a97
jmp 0x42a80
movl 0x8(%rsp), %eax
subl $0x5, %eax
je 0x42aa3
jmp 0x42a8b
movq (%rsp), %rax
movl 0x48(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x42aad
movq (%rsp), %rax
movl 0x48(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x42aad
movq (%rsp), %rcx
movl 0x48(%rsp), %eax
xchgl %eax, (%rcx)
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x80, %rsi
addq $0x80, %rdi
callq 0x44360
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0xc0, %rsi
addq $0xc0, %rdi
callq 0x443c0
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x78, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::TryPut(hlkvds::Request*)
bool SegForReq::TryPut(Request* req) {
    if (isCompletion_) {
        return false;
    }
    KVSlice *slice= &req->GetSlice();
    return SegBase::TryPut(slice);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
testb $0x1, 0x78(%rax)
je 0x42c14
movb $0x0, 0x27(%rsp)
jmp 0x42c37
movq 0x10(%rsp), %rdi
callq 0x16a90
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rsi
callq 0x418e0
andb $0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::Put(hlkvds::Request*)
void SegForReq::Put(Request* req) {
    KVSlice *slice = &req->GetSlice();
    if (GetKeyNum() == 0) {
        hasReq_ = true;
        startTime_.Update();
    }
    SegBase::Put(slice);
    reqList_.push_back(req);
    req->SetSeg(this);
    __DEBUG("Put request key = %s", req->GetSlice().GetKeyStr().c_str());
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0x16a90
movq 0x8(%rsp), %rdi
movq %rax, 0x10(%rsp)
callq 0x44420
cmpl $0x0, %eax
jne 0x42c98
movq 0x8(%rsp), %rdi
movb $0x1, 0x79(%rdi)
addq $0x58, %rdi
callq 0x50710
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x41960
movq 0x8(%rsp), %rdi
addq $0x80, %rdi
leaq 0x18(%rsp), %rsi
callq 0x44430
movq 0x8(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x44470
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::IsExpired()
bool SegForReq::IsExpired() {
    KVTime nowTime;
    if (!hasReq_) {
        return false;
    }
    int64_t interval = nowTime - startTime_;
    return (interval > timeout_);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x50730
movq 0x10(%rsp), %rax
testb $0x1, 0x79(%rax)
jne 0x43067
movb $0x0, 0x57(%rsp)
movl $0x1, 0x34(%rsp)
jmp 0x430c8
movq 0x10(%rsp), %rsi
addq $0x58, %rsi
leaq 0x38(%rsp), %rdi
callq 0x508e0
movq %rax, 0x8(%rsp)
jmp 0x43081
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl 0x50(%rcx), %ecx
cmpq %rcx, %rax
setg %al
andb $0x1, %al
movb %al, 0x57(%rsp)
movl $0x1, 0x34(%rsp)
jmp 0x430c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x50920
jmp 0x430dd
leaq 0x38(%rsp), %rdi
callq 0x50920
movb 0x57(%rsp), %al
andb $0x1, %al
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8820
nopw (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::CleanDeletedEntry()
void SegForReq::CleanDeletedEntry() {
    std::lock_guard < std::mutex > l(mtx_);
    for (list<HashEntry>::iterator iter = delReqList_.begin(); iter
            != delReqList_.end(); iter++) {
        idxMgr_->RemoveEntry(*iter);
    }
    delReqList_.clear();
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rsi
movq %rsi, 0x10(%rsp)
addq $0x98, %rsi
leaq 0x58(%rsp), %rdi
callq 0xb5f0
movq 0x10(%rsp), %rdi
addq $0xc0, %rdi
callq 0x44620
movq %rax, 0x50(%rsp)
movq 0x10(%rsp), %rdi
addq $0xc0, %rdi
callq 0x44670
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x44650
testb $0x1, %al
jne 0x43155
jmp 0x431d4
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x446a0
movq %rax, %rsi
leaq 0x30(%rsp), %rdi
callq 0x252e0
jmp 0x4317c
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x26930
jmp 0x4318d
leaq 0x30(%rsp), %rdi
callq 0x253b0
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0x446c0
movq %rax, 0x18(%rsp)
jmp 0x4312a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0x431f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x253b0
jmp 0x431f4
movq 0x10(%rsp), %rdi
addq $0xc0, %rdi
callq 0x446f0
leaq 0x58(%rsp), %rdi
callq 0xb830
addq $0x68, %rsp
retq
leaq 0x58(%rsp), %rdi
callq 0xb830
movq 0x28(%rsp), %rdi
callq 0x8820
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForSlice::operator=(hlkvds::SegForSlice const&)
SegForSlice& SegForSlice::operator=(const SegForSlice& toBeCopied) {
    if (this == &toBeCopied) {
        return *this;
    }
    SegBase::operator=(toBeCopied);
    idxMgr_ = toBeCopied.idxMgr_;
    return *this;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq 0x10(%rsp), %rax
jne 0x432bb
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x432e1
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x41830
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x48(%rcx), %rcx
movq %rcx, 0x48(%rax)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForMigrate::operator=(hlkvds::SegForMigrate const&)
SegForMigrate& SegForMigrate::operator=(const SegForMigrate& toBeCopied) {
    if (this == &toBeCopied) {
        return *this;
    }
    SegBase::operator=(toBeCopied);
    idxMgr_ = toBeCopied.idxMgr_;
    return *this;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq 0x10(%rsp), %rax
jne 0x433db
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x43401
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x41830
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq 0x48(%rcx), %rcx
movq %rcx, 0x48(%rax)
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::copyHelper(hlkvds::SegLatencyFriendly const&)
void SegLatencyFriendly::copyHelper(const SegLatencyFriendly& toBeCopied) {
    segId_ = toBeCopied.segId_;
    vol_ = toBeCopied.vol_;
    segSize_ = toBeCopied.segSize_;

    headPos_ = toBeCopied.headPos_;
    keyNum_ = toBeCopied.keyNum_;
    checksumSize_ = toBeCopied.checksumSize_;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq -0x10(%rsp), %rcx
movl 0x10(%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rsp), %rcx
movl 0x14(%rcx), %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rsp), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rsp), %rcx
movl 0x1c(%rcx), %ecx
movl %ecx, 0x1c(%rax)
movq -0x10(%rsp), %rcx
movl 0x20(%rcx), %ecx
movl %ecx, 0x20(%rax)
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::Put(hlkvds::KVSlice*)
void SegLatencyFriendly::Put(KVSlice* slice) {
    headPos_ += IndexManager::SizeOfDataHeader() + slice->GetKeyLen() + slice->GetDataLen();
    keyNum_++;
    sliceList_.push_back(slice);
    __DEBUG("Put request key = %s", slice->GetKeyStr().c_str());
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x238d0
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
callq 0x44260
movw %ax, %cx
movq (%rsp), %rax
movzwl %cx, %ecx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
callq 0x163a0
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdi
movzwl %ax, %eax
addq %rax, %rcx
movl 0x18(%rdi), %eax
addq %rcx, %rax
movl %eax, 0x18(%rdi)
movl 0x1c(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rdi)
addq $0x28, %rdi
leaq 0x18(%rsp), %rsi
callq 0x235f0
addq $0x28, %rsp
retq
nopl (%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::TryPutList(std::__cxx11::list<hlkvds::KVSlice*, std::allocator<hlkvds::KVSlice*>>&)
bool SegLatencyFriendly::TryPutList(std::list<KVSlice*> &slice_list) {
    uint32_t free_size = segSize_ - headPos_;
    uint32_t need_size = 0;
    for (list<KVSlice *>::iterator iter = slice_list.begin(); iter != slice_list.end(); iter++) {
        KVSlice *slice = *iter;
        need_size += slice->GetDataLen() + slice->GetKeyLen() + IndexManager::SizeOfDataHeader();
    }
    return free_size > need_size;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq 0x40(%rsp), %rcx
movl 0x14(%rcx), %eax
subl 0x18(%rcx), %eax
movl %eax, 0x34(%rsp)
movl $0x0, 0x30(%rsp)
movq 0x38(%rsp), %rdi
callq 0x16410
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rdi
callq 0x16460
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x16440
testb $0x1, %al
jne 0x437d8
jmp 0x43846
leaq 0x28(%rsp), %rdi
callq 0x16490
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x163a0
movzwl %ax, %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdi
callq 0x44260
movw %ax, %cx
movl 0x4(%rsp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
cltq
movq %rax, 0x8(%rsp)
callq 0x238d0
movq 0x8(%rsp), %rcx
addq %rax, %rcx
movl 0x30(%rsp), %eax
addq %rcx, %rax
movl %eax, 0x30(%rsp)
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x164c0
movq %rax, 0x10(%rsp)
jmp 0x437b4
movl 0x34(%rsp), %eax
cmpl 0x30(%rsp), %eax
seta %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::_writeDataToDevice()
bool SegLatencyFriendly::_writeDataToDevice() {
    checksumSize_ = headPos_ - SegBase::SizeOfSegOnDisk();
    uint32_t pages_num = headPos_ / getpagesize();
    uint32_t aligned_size = ( pages_num + 1 ) * getpagesize();

    posix_memalign((void**)&dataBuf_, 4096, aligned_size);

    copyToDataBuf();
    uint64_t offset = 0;
    vol_->CalcSegOffsetFromId(segId_, offset);

    bool ret = vol_->Write(dataBuf_, aligned_size, offset);

    free(dataBuf_);
    dataBuf_ = NULL;


    return ret;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x18(%rax), %eax
movq %rax, (%rsp)
callq 0x166a0
movq (%rsp), %rcx
movq %rax, %rdx
movq 0x10(%rsp), %rax
subq %rdx, %rcx
movl %ecx, 0x20(%rax)
movl 0x18(%rax), %eax
movl %eax, 0x8(%rsp)
callq 0x8860
movl %eax, %ecx
movl 0x8(%rsp), %eax
xorl %edx, %edx
divl %ecx
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
callq 0x8860
movq 0x10(%rsp), %rdi
movl %eax, %ecx
movl 0xc(%rsp), %eax
imull %ecx, %eax
movl %eax, 0x28(%rsp)
addq $0x40, %rdi
movl 0x28(%rsp), %eax
movl %eax, %edx
movl $0x1000, %esi           # imm = 0x1000
callq 0x8230
movq 0x10(%rsp), %rdi
callq 0x43ea0
movq 0x10(%rsp), %rax
movq $0x0, 0x20(%rsp)
movq (%rax), %rdi
movl 0x10(%rax), %esi
leaq 0x20(%rsp), %rdx
callq 0x23960
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rax), %rsi
movl 0x28(%rsp), %eax
movl %eax, %edx
movq 0x20(%rsp), %rcx
callq 0x50fa0
movb %al, %cl
movq 0x10(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x1f(%rsp)
movq 0x40(%rax), %rdi
callq 0x85b0
movq 0x10(%rsp), %rax
movq $0x0, 0x40(%rax)
movb 0x1f(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::Get(char*, unsigned long)
bool SegmentManager::Get(char* buf, uint64_t length) {
    uint64_t stat_size = SegmentManager::SizeOfSegmentStat();
    uint64_t stat_table_size = stat_size * segNum_;
    if (length != stat_table_size) {
        return false;
    }
    char *buf_ptr = buf;
    for (uint32_t seg_idx = 0; seg_idx < segNum_; seg_idx++) {
        if (segTable_[seg_idx].state != SegUseStat::RESERVED) {
            memcpy((void *)buf_ptr, (const void *)&segTable_[seg_idx], stat_size);
        } else {
            __WARN("Segment Maybe not write to device! seg_id = %d", seg_idx);
        }
        buf_ptr += stat_size;
    }

    return true;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
callq 0x47a90
movq 0x10(%rsp), %rcx
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movl 0x20(%rcx), %ecx
imulq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x46e73
movb $0x0, 0x57(%rsp)
jmp 0x46f72
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x10(%rsp), %rcx
movl 0x1c(%rsp), %eax
cmpl 0x20(%rcx), %eax
jae 0x46f6d
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x47aa0
cmpl $0x2, (%rax)
je 0x46eda
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, %esi
callq 0x47aa0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x30(%rsp), %rdx
callq 0x8410
jmp 0x46f4e
jmp 0x46edc
movq 0x2a0f5(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, (%rsp)
callq 0x8480
movq (%rsp), %rdi
movq %rax, %rdx
leaq 0xbe00(%rip), %rsi      # 0x52cfd
leaq 0xd36f(%rip), %rcx      # 0x54273
leaq 0xd36c(%rip), %r8       # 0x54277
movl $0x12, %r9d
movb $0x0, %al
callq 0x86f0
movq 0x2a0b9(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
movl 0x1c(%rsp), %edx
leaq 0xd360(%rip), %rsi      # 0x5428d
movb $0x0, %al
callq 0x86f0
movq 0x2a09d(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0xbe80(%rip), %rsi      # 0x52dc5
movb $0x0, %al
callq 0x86f0
jmp 0x46f4e
movq 0x30(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x46e85
movb $0x1, 0x57(%rsp)
movb 0x57(%rsp), %al
andb $0x1, %al
addq $0x58, %rsp
retq
nopl (%rax)