LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictNextPower(unsigned long)
static unsigned long _dictNextPower(unsigned long size)
{
	unsigned long i = DICT_HT_INITIAL_SIZE;

	if (size >= LONG_MAX)
		return LONG_MAX;
	
	while (1) {
		if (i >= size)
			return i;
		i *= 2;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq $0x4, -0x18(%rbp)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x10(%rbp)
jb 0x3cd0
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x8(%rbp)
jmp 0x3cf3
jmp 0x3cd2
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jb 0x3ce6
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3cf3
movq -0x18(%rbp), %rax
shlq %rax
movq %rax, -0x18(%rbp)
jmp 0x3cd2
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictReset(dictht*)
static void _dictReset(dictht *ht)
{
	ht->size = 0;
	ht->size_mask = 0;
	ht->used = 0;
	ht->table = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictFind(dict*, void const*)
dictEntry *dictFind(dict *d, const void *key)
{
	dictEntry *de;
	unsigned int h, idx, table;
	
	if (d->ht[0].size == 0)
		return NULL;

	if (dictIsRehashing(d))
		_dictRehashStep(d);
	h = d->type->hashFunction(key);
	
	for (table = 0; table < 2; ++table) {
		idx = h & d->ht[table].size_mask;
		de = d->ht[table].table[idx];
		while (de) {
			if (dictCompareKeys(d, key, de->key)) {
				return de;
			}
			de = de->next;
		}
		if (!dictIsRehashing(d))
			break;
	}
	
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x3d68
movq $0x0, -0x8(%rbp)
jmp 0x3e6f
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x50(%rax)
je 0x3d7b
movq -0x10(%rbp), %rdi
callq 0x3760
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movl %eax, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x2, -0x2c(%rbp)
jae 0x3e67
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
addq $0x10, %rcx
movl -0x2c(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
andq 0x18(%rcx), %rax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rax
movl -0x2c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3e4b
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x3e15
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
callq *%rax
movl %eax, -0x30(%rbp)
jmp 0x3e2b
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl $0x0, %eax
je 0x3e3d
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3e6f
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x3ddb
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x50(%rax)
jne 0x3e57
jmp 0x3e67
jmp 0x3e59
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3d95
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictGetIterator(dict*)
dictIterator *dictGetIterator(dict *d)
{
	dictIterator * iter = (dictIterator *)zmalloc(sizeof(struct dictIterator));
	if (iter == NULL)
		return NULL;

	iter->d = d;
	iter->table = 0;
	iter->index = -1;
	iter->safe = 0;
	iter->entry = NULL;
	iter->nextEntry = NULL;

	return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x28, %edi
callq 0x5710
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3efb
movq $0x0, -0x8(%rbp)
jmp 0x3f48
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $-0x1, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictNext(dictIterator*)
dictEntry *dictNext(dictIterator *iter)
{
	while (1) {
		if (iter->entry == NULL) {
			dictht *ht = &iter->d->ht[iter->table];
			if (iter->index == -1 && iter->table == 0) {
				if (iter->safe)
					++iter->d->iterator;
			}
			++iter->index;
			if (iter->index >= (long)ht->size) {
				if (dictIsRehashing(iter->d) && iter->table == 0) {
					++iter->table;
					iter->index = 0;
					ht = &iter->d->ht[1];
				}
				else
					break;
			}
			iter->entry = ht->table[iter->index];
		}
		else {
			iter->entry = iter->nextEntry;
		}

		if (iter->entry) {
			iter->nextEntry = iter->entry->next;
			return iter->entry;
		}
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x407e
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $0x10, %rax
movq -0x10(%rbp), %rcx
movslq 0x10(%rcx), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $-0x1, 0x8(%rax)
jne 0x3ff6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x3ff6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x3ff4
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x54(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x54(%rax)
jmp 0x3ff6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x4061
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $-0x1, 0x50(%rax)
je 0x405d
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x405d
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
addq $0x10, %rax
addq $0x20, %rax
movq %rax, -0x18(%rbp)
jmp 0x405f
jmp 0x40c0
jmp 0x4061
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x408e
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x40bb
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x40c8
jmp 0x3f98
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictReleaseIterator(dictIterator*)
void dictReleaseIterator(dictIterator *iter)
{
	if (!(iter->index == -1 && iter->table == 0)){
		if (iter->safe)
			--iter->d->iterator;
	}

	zfree(iter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $-0x1, 0x8(%rax)
jne 0x40f1
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x410d
movq -0x8(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x410b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x54(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x54(%rax)
jmp 0x410d
movq -0x8(%rbp), %rdi
callq 0x5a10
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictClear(dict*, dictht*, void (*)(void*))
int _dictClear(dict *d, dictht*ht, void(callback)(void *))
{
	unsigned long i;

	for (i = 0; i < ht->size && ht->used >0; ++i) {
		dictEntry *de, *nextde;
		if (callback && (i & 65536) == 0)
			callback(d->privdata);
		if ((de = ht->table[i]) == NULL)
			continue;
		while (de) {
			nextde = de->next;
			dictFreeKey(d, de);
			dictFreeVal(d, de);
			zfree(de);
			--ht->used;
			de = nextde;
		}
	}
	zfree(ht->table);
	_dictReset(ht);

	return DICT_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x10(%rdx), %rcx
movb %al, -0x31(%rbp)
jae 0x43ae
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
seta %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x43ba
jmp 0x44a4
cmpq $0x0, -0x18(%rbp)
je 0x43df
movq -0x20(%rbp), %rax
andq $0x10000, %rax          # imm = 0x10000
cmpq $0x0, %rax
jne 0x43df
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x43fd
jmp 0x4493
jmp 0x43ff
cmpq $0x0, -0x28(%rbp)
je 0x4491
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x4440
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x28(%rbp), %rcx
movq (%rcx), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x446b
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x28(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
movq -0x28(%rbp), %rdi
callq 0x5a10
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x43ff
jmp 0x4493
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x438c
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x5a10
movq -0x10(%rbp), %rdi
callq 0x3d00
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictAdd(dict*, void*, void*)
int dictAdd(dict *d, void *key, void *val)
{
	dictEntry *de = dictAddRaw(d, key);
	
	if (!de)
		return DICT_ERR;
	dictSetVal(d, de, val);
	
	return DICT_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x39b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x4555
movl $0x1, -0x4(%rbp)
jmp 0x45a0
jmp 0x4557
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x458b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x20(%rbp), %rsi
callq *%rax
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x4597
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x4599
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: startCompressRDB(redisDb*, char*, unsigned long*)
size_t startCompressRDB(redisDb *db, char *buf, size_t *pos)
{
	dict *d = db->dict;
	dictIterator *iter = dictGetSafeIterator(d);
	dictEntry *de;
	char sizebuf[SIZEBUF];
	//so. At first the "REDIS" should be compressed
	//it is a symbolof rdb file.
	memcpy(buf, "REDIS", 5);
	*pos += 5;
	size_t totlen = 5;
	while ((de = dictNext(iter)) != NULL) {
		totlen += compressToRDB(de, buf, pos);
	}
	//length totlen is excluded in totlen.
	//the stand of eof is "$$"
	//and last compressing the 'totlen'
	memcpy(buf + *pos, "$$", 2);
	*pos += 2;
	totlen += 2;
	parseSdsSize(totlen, sizebuf);
	memcpy(buf + *pos, sizebuf, strlen(sizebuf));
	size_t tlen = strlen(sizebuf);
	*pos += tlen;
	totlen += tlen;
	memset(buf + *pos, 0, 1);
	return totlen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3f60
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x2cb5(%rip), %ecx      # 0x729b
movl %ecx, (%rax)
movb 0x2cb1(%rip), %cl       # 0x729f
movb %cl, 0x4(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x5, %rcx
movq %rcx, (%rax)
movq $0x5, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3f90
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x4635
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x46f0
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x4607
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movw 0x2c5a(%rip), %dx       # 0x72a1
movw %dx, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl %eax, %edi
leaq -0x40(%rbp), %rsi
callq 0x4810
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10a0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq %rax, %rdx
callq 0x1120
leaq -0x40(%rbp), %rdi
callq 0x10a0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x10e0
movq -0x48(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: compressToRDB(dictEntry*, char*, unsigned long*)
size_t compressToRDB(dictEntry *de, char *buf, size_t *pos)
{
	size_t keysize;
	size_t valsize;
	robj *key = (robj *)de->key;
	robj *val = (robj *)de->val;
	
	switch (val->type) {
	case REDIS_STRING:
		keysize = compressKeyToRDB(key, buf, pos, REDIS_STRING);
		valsize = compressStringValueToRDB(val, buf, pos);
		break;
	case REDIS_LIST:
		keysize = compressKeyToRDB(key, buf, pos, REDIS_LIST);
		valsize = compressListValueToRDB(val, buf, pos);
		break;
	case REDIS_HASH:
		keysize = compressKeyToRDB(key, buf, pos, REDIS_HASH);
		valsize = compressHashValueToRDB(val, buf, pos);
		break;
	default:
		assert(0);
	}
	// extra 1 byte for type
	return keysize + valsize + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
subl $0x1, %eax
je 0x4742
jmp 0x472b
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x4776
jmp 0x4735
movl -0x3c(%rbp), %eax
subl $0x3, %eax
je 0x47a7
jmp 0x47d8
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x4940
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a10
movq %rax, -0x28(%rbp)
jmp 0x47f7
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x2, %ecx
callq 0x4940
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a50
movq %rax, -0x28(%rbp)
jmp 0x47f7
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl $0x3, %ecx
callq 0x4940
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4b10
movq %rax, -0x28(%rbp)
jmp 0x47f7
leaq 0x294d(%rip), %rdi      # 0x712c
leaq 0x2abe(%rip), %rsi      # 0x72a4
movl $0x47, %edx
leaq 0x2aba(%rip), %rcx      # 0x72ac
callq 0x1100
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
addq $0x1, %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: parseSdsSize(int, char*)
static void parseSdsSize(int val, char *buf)
{
	int i;
	for (i = 0; i < SIZEBUF - 2; ++i) {
		if (!val)
			break;
		int aux = val % 10;
		val /= 10;
		char p = '0' + aux;
		memset(buf + i, p, 1);
	}
	memset(buf + i, 0, 1);

	int len = strlen(buf);
	char *e = buf + len - 1;
	char *s = buf;
	char c;
	while (s < e) {
		c = *s;
		*s = *e;
		*e = c;
		++s;
		--e;
	}
	memset(buf + i, '.', 1);
	memset(buf + i + 1, '\0', 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0xe, -0x14(%rbp)
jge 0x4880
cmpl $0x0, -0x4(%rbp)
jne 0x4834
jmp 0x4880
movl -0x4(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
movl -0x4(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, -0x4(%rbp)
movl -0x18(%rbp), %eax
addl $0x30, %eax
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movsbl -0x19(%rbp), %eax
movl $0x1, %edx
movzbl %al, %esi
callq 0x10e0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4826
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x10e0
movq -0x10(%rbp), %rdi
callq 0x10a0
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4900
movq -0x30(%rbp), %rax
movb (%rax), %al
movb %al, -0x31(%rbp)
movq -0x28(%rbp), %rax
movb (%rax), %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
movb -0x31(%rbp), %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x48be
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movl $0x2e, %esi
movl $0x1, %edx
callq 0x10e0
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
addq $0x1, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x10e0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: compressKeyToRDB(redisObject*, char*, unsigned long*, int)
size_t compressKeyToRDB(robj *key, char *buf, size_t *pos, int type)
{
	switch (type) {
	case REDIS_STRING:
		memset(buf + *pos, '1', 1);
		break;
	case REDIS_LIST:
		memset(buf + *pos, '2', 1);
		break;
	case REDIS_HASH:
		memset(buf + *pos, '3', 1);
		break;
	default:
		assert(0);
	}
	++*pos;
	return compressStringValueToRDB(key, buf, pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
subl $0x1, %eax
je 0x4978
jmp 0x4964
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x4994
jmp 0x496e
movl -0x20(%rbp), %eax
subl $0x3, %eax
je 0x49b0
jmp 0x49cc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
movl $0x31, %esi
movl $0x1, %edx
callq 0x10e0
jmp 0x49eb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
movl $0x32, %esi
movl $0x1, %edx
callq 0x10e0
jmp 0x49eb
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
movl $0x33, %esi
movl $0x1, %edx
callq 0x10e0
jmp 0x49eb
leaq 0x2759(%rip), %rdi      # 0x712c
leaq 0x28ca(%rip), %rsi      # 0x72a4
movl $0x6e, %edx
leaq 0x28fa(%rip), %rcx      # 0x72e0
callq 0x1100
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a10
addq $0x20, %rsp
popq %rbp
retq
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: compressListValueToRDB(redisObject*, char*, unsigned long*)
size_t compressListValueToRDB(robj *val, char *buf, size_t *pos)
{
	size_t len = 0;
	list *l = (list *)val->ptr;
	listIterator *iter = listGetIterator(l, AL_START_HEAD);
	listNode *node;

	size_t slen = l->len;
	len = compressLenToRDB(slen, buf, pos);
	*pos += len;
	
	while ((node = listNext(iter)) != NULL) {
		robj *s = (robj *)(node->value);
		len += compressStringValueToRDB(s, buf, pos);
	}
	listReleaseIterator(iter);

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x16a0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4ca0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rdi
callq 0x1730
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x4af0
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a10
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4ab6
movq -0x30(%rbp), %rdi
callq 0x1710
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: compressHashValueToRDB(redisObject*, char*, unsigned long*)
size_t compressHashValueToRDB(robj *val, char *buf, size_t *pos)
{
	size_t len = 0;
	dict *d = (dict *)val->ptr;

	//Secondly, compressing the size of dictentry used. 
	size_t slen = d->ht[0].used + d->ht[1].used;
	len = compressLenToRDB(slen, buf, pos);
	*pos += len;

	dictIterator *iter = dictGetSafeIterator(d);
	dictEntry *de;

	while ((de = dictNext(iter)) != NULL) {
		robj* key = (robj*)de->key;
		robj* val = (robj*)de->val;
		len += compressStringValueToRDB(key, buf, pos);
		len += compressStringValueToRDB(val, buf, pos);
	}
	dictReleaseIterator(iter);

	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x28(%rbp), %rcx
addq 0x38(%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4ca0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x3f60
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x3f90
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x4bda
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a10
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4a10
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4b7c
movq -0x38(%rbp), %rdi
callq 0x40d0
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: compressSdsToRDB(char*, char*, unsigned long*)
size_t compressSdsToRDB(sds s, char *buf, size_t *pos)
{	
	struct sdshdr *sh = (struct sdshdr *)(s - sizeof(struct sdshdr));
	size_t sdslen = sh->len;
	size_t sizelen;
	char sizebuf[SIZEBUF];
	
	parseSdsSize(sdslen, sizebuf);
	sizelen = strlen(sizebuf);
	memcpy(buf + *pos, sizebuf, sizelen);
	*pos += sizelen;
	memcpy(buf + *pos, sh->buf, sdslen);
	*pos += sdslen;
	return sdslen + sizelen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl %eax, %edi
leaq -0x40(%rbp), %rsi
callq 0x4810
leaq -0x40(%rbp), %rdi
callq 0x10a0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
leaq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x1120
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
movq -0x28(%rbp), %rdx
callq 0x1120
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: compressLenToRDB(unsigned long, char*, unsigned long*)
static size_t compressLenToRDB(size_t slen, char *buf, size_t *pos)
{
	char sizebuf[SIZEBUF];
	parseSdsSize(slen, sizebuf);	
	size_t len = strlen(sizebuf);
	memcpy(buf + *pos, sizebuf, len);
	return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl %eax, %edi
leaq -0x30(%rbp), %rsi
callq 0x4810
leaq -0x30(%rbp), %rdi
callq 0x10a0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
leaq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x1120
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: startLoadFromRDB(redisClient*, char*, unsigned long*)
void startLoadFromRDB(redisClient *client, char *buf, size_t *pos)
{
	dict *d = client->db->dict;
	size_t totlen = 0;
	size_t buflen = strlen(buf);
	if(*buf != 'R' || *(buf + 1) != 'E' || *(buf + 2) != 'D' ||
			*(buf + 3) != 'I' || *(buf + 4) != 'S'){
		perror("load error of rdb file: ");
		exit(1);
	}
	*pos += 5;
	
	
	while (totlen < buflen) {
		totlen += *pos;
		if (*(buf + *pos) == '$' && *(buf + *pos + 1) == '$')
			break;
		extractFromRDB(d, buf, pos);
	}
	totlen += 2;
	
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x52, %eax
jne 0x4d77
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x45, %eax
jne 0x4d77
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x44, %eax
jne 0x4d77
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x49, %eax
jne 0x4d77
movq -0x10(%rbp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x53, %eax
je 0x4d8d
leaq 0x2599(%rip), %rdi      # 0x7317
callq 0x1130
movl $0x1, %edi
callq 0x1190
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x5, %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x4df2
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x24, %eax
jne 0x4ddf
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movsbl 0x1(%rax,%rcx), %eax
cmpl $0x24, %eax
jne 0x4ddf
jmp 0x4df2
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4e10
jmp 0x4d9b
movq -0x28(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x28(%rbp)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: extractFromRDB(dict*, char*, unsigned long*)
void extractFromRDB(dict *d ,char *buf, size_t *pos)
{
	size_t totlen = 0;
	char c = *(buf + *pos);
	int type = c - '0';
	++*pos;
	robj *key = extractStringObjectFromRDB(buf, pos);
	robj *val;
	
	switch (type) {
	case REDIS_STRING:
		val = extractStringObjectFromRDB(buf, pos);
		break;
	case REDIS_LIST:
		val = extractListObjectFromRDB(buf, pos);
		break;
	case REDIS_HASH:
		val = extractHashObjectFromRDB(buf, pos);
		break;
	default:
		assert(0);
	}
	dictAdd(d, key, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movb (%rax,%rcx), %al
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
addl $-0x30, %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
incq %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f00
movq %rax, -0x30(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x3c(%rbp)
subl $0x1, %eax
je 0x4e86
jmp 0x4e72
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x4e99
jmp 0x4e7c
movl -0x3c(%rbp), %eax
subl $0x3, %eax
je 0x4eac
jmp 0x4ebf
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f00
movq %rax, -0x38(%rbp)
jmp 0x4ede
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f40
movq %rax, -0x38(%rbp)
jmp 0x4ede
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4fd0
movq %rax, -0x38(%rbp)
jmp 0x4ede
leaq 0x2266(%rip), %rdi      # 0x712c
leaq 0x23d7(%rip), %rsi      # 0x72a4
movl $0xfe, %edx
leaq 0x2457(%rip), %rcx      # 0x7330
callq 0x1100
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x4520
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: extractListObjectFromRDB(char*, unsigned long*)
robj *extractListObjectFromRDB(char *buf, size_t *pos)
{
	robj *o = createListObject();
	list *l = listCreate();

	size_t slen = parseSdsIntVal(buf, pos);
	((list *)o->ptr)->len = slen;

	while (slen--) {
		robj* s = extractStringObjectFromRDB(buf, pos);
		listAddNodeHead(l, s);
	}
	o->ptr = l;

	return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x6450
movq %rax, -0x18(%rbp)
callq 0x1380
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x50d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x28(%rbp)
cmpq $0x0, %rax
je 0x4fb8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4f00
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1400
jmp 0x4f83
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: extractHashObjectFromRDB(char*, unsigned long*)
robj *extractHashObjectFromRDB(char *buf, size_t *pos)
{
	robj *o = createHashObject();
	dict *d = dictCreate(&dictObjectType, NULL);

	size_t slen = parseSdsIntVal(buf, pos);
	while (slen--) {
		robj* key = extractStringObjectFromRDB(buf, pos);
		robj* val = extractStringObjectFromRDB(buf, pos);

		dictAdd(d, key, val);
	}
	o->ptr = d;

	return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x64b0
movq %rax, -0x18(%rbp)
leaq 0x5188(%rip), %rdi      # 0xa178
xorl %eax, %eax
movl %eax, %esi
callq 0x3be0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x50d0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x28(%rbp)
cmpq $0x0, %rax
je 0x5058
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4f00
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4f00
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x4520
jmp 0x500e
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: extractFromSdsLen(char*, unsigned long*)
size_t extractFromSdsLen(char *buf, size_t *pos)
{
	size_t slen;

	char c = *(buf + (*pos));
	if (REDIS_IS_DIGIT(c)) {
		slen = parseSdsIntVal(buf, pos);
		return slen;
	}
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movb (%rax,%rcx), %al
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x39, %eax
jg 0x50be
movsbl -0x21(%rbp), %eax
cmpl $0x30, %eax
jl 0x50be
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x50d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x50c6
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: parseSdsIntVal(char*, unsigned long*)
static size_t parseSdsIntVal(char *buf, size_t *pos)
{
	size_t len, ret = 0;
	char *point = strchr(buf + *pos, '.');
	char *head = buf + *pos;
	if (point == NULL)
		return 0;
	else if (point - head > 14)
		return 0;

	len = point - head;
	size_t p = 1;
	size_t i = len - 1;
	while (i-- > 0) {
		p *= 10;
	}

	while (len--) {
		char c = *(buf + *pos);
		++(*pos);
		int i = c - '0';
		ret = ret + i * p;
		p /= 10;
		if (p == 0)
			p = 1;
	}
	//skip point '.'
	++*pos;

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
addq (%rax), %rdi
movl $0x2e, %esi
callq 0x1090
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5124
movq $0x0, -0x8(%rbp)
jmp 0x5214
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
cmpq $0xe, %rax
jle 0x5142
movq $0x0, -0x8(%rbp)
jmp 0x5214
jmp 0x5144
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq $0x1, -0x40(%rbp)
movq -0x20(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x48(%rbp)
cmpq $0x0, %rax
jbe 0x5187
imulq $0xa, -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x5167
jmp 0x5189
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x20(%rbp)
cmpq $0x0, %rax
je 0x51fe
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movb (%rax,%rcx), %al
movb %al, -0x49(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movsbl -0x49(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movslq -0x50(%rbp), %rcx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x51fc
movq $0x1, -0x40(%rbp)
jmp 0x5189
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: TTLIUJJ[P]acker_redis/rdb.cpp
// Function: extractSdsFromRDB(char*, unsigned long*)
sds extractSdsFromRDB(char *buf, size_t *pos)
{
	char p[SDSBUF];
	size_t slen = extractFromSdsLen(buf, pos);

	if (!slen && slen >= SDSBUF){
		perror("extractSdsFromRDB error:");
		exit(1);
	}
	memcpy(p, buf + *pos, slen);
	*pos += slen;
	sds s = sdsNewlen(p, slen);

	return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10020, %rsp          # imm = 0x10020
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5070
movq %rax, -0x10018(%rbp)
cmpq $0x0, -0x10018(%rbp)
jne 0x5274
cmpq $0x10000, -0x10018(%rbp) # imm = 0x10000
jb 0x5274
leaq 0x20f9(%rip), %rdi      # 0x735e
callq 0x1130
movl $0x1, %edi
callq 0x1190
leaq -0x10010(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rax
addq (%rax), %rsi
movq -0x10018(%rbp), %rdx
callq 0x1120
movq -0x10018(%rbp), %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
leaq -0x10010(%rbp), %rdi
movq -0x10018(%rbp), %rsi
callq 0x52d0
movq %rax, -0x10020(%rbp)
movq -0x10020(%rbp), %rax
addq $0x10020, %rsp          # imm = 0x10020
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/sds.cpp
// Function: sdsNewlen(void const*, unsigned long)
sds sdsNewlen(const void *init, size_t len)
{
	struct sdshdr *sh;

	if (init) {
		sh = (struct sdshdr *)zmalloc(sizeof(struct sdshdr) + len + 1);
	}
	else {
		sh = (struct sdshdr *)zcalloc(sizeof(struct sdshdr) + len + 1);
	}
	if (sh == NULL)
		return NULL;
	sh->len = len;
	sh->free = 0;
	if (init && len)
		memcpy(sh->buf, init, len);
	sh->buf[len] = '\0';

	return (char *)sh->buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x52fe
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
addq $0x1, %rdi
callq 0x5710
movq %rax, -0x20(%rbp)
jmp 0x5313
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
addq $0x1, %rdi
callq 0x5800
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5324
movq $0x0, -0x8(%rbp)
jmp 0x5377
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x4(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x535e
cmpq $0x0, -0x18(%rbp)
je 0x535e
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1120
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, 0x8(%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/sds.cpp
// Function: sdsFree(char*)
void sdsFree(sds s)
{
	if (s == NULL)
		return;
	char *p = s - sizeof(struct sdshdr);
	zfree(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x5445
jmp 0x545a
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5a10
addq $0x10, %rsp
popq %rbp
retq
// File: TTLIUJJ[P]acker_redis/sds.cpp
// Function: sdsClear(char*)
void sdsClear(sds s)
{
	struct sdshdr *sh = (struct sdshdr *)(s - sizeof(struct sdshdr));
	sh->free += sh->len;
	sh->len = 0;
	sh->buf[0] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: TTLIUJJ[P]acker_redis/sds.cpp
// Function: sdsCmp(char*, char*)
int sdsCmp(const sds s1, const sds s2)
{
	size_t l1, l2, minlen;
	
	l1 = strlen(s1);
	l2 = strlen(s2);
	minlen = l1 > l2 ? l2 : l1;
	int cmp = memcmp(s1, s2, minlen);
	if (cmp == 0)
		return l1 - l2;
	else
		return cmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10a0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10a0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jbe 0x54de
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x54e6
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x10c0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x5515
movq -0x20(%rbp), %rax
subq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x551b
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/sds.cpp
// Function: sdsMakeRoomFor(char*, unsigned long)
sds sdsMakeRoomFor(sds s, size_t addlen)
{
	struct sdshdr *sh, *newsh;
	size_t free = sdsavail(s);
	size_t len, newlen;

	if (free > addlen)
		return s;
	
	sh = (struct sdshdr *)(s - sizeof(struct sdshdr));
	len = sdslen(s);
	newlen = sh->len + addlen;
	if (newlen < SDS_MAX_PERALLOC)
		newlen *= 2;
	else
		newlen += SDS_MAX_PERALLOC;
	
	newsh = (struct sdshdr *)zrealloc(sh, sizeof(struct sdshdr) + newlen + 1);
	if (newsh == NULL)
		return NULL;

	newsh->len = newlen;
	newsh->free = newlen - len;

	return newsh->buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5610
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0x5564
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5603
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5630
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
addq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x100000, -0x40(%rbp)  # imm = 0x100000
jae 0x55a2
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x40(%rbp)
jmp 0x55b0
movq -0x40(%rbp), %rax
addq $0x100000, %rax         # imm = 0x100000
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
addq $0x1, %rsi
callq 0x5870
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x55da
movq $0x0, -0x8(%rbp)
jmp 0x5603
movq -0x40(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
subq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/sds.cpp
// Function: sdsCat(char*, char const*)
sds sdsCat(sds s, const char *p)
{
	size_t curlen = sdslen(s);
	size_t len = strlen(p);
	
	s = sdsMakeRoomFor(s, len);
	if (s == NULL)
		return NULL;

	struct sdshdr *sh = (struct sdshdr *)(s - (sizeof(struct sdshdr)));
	memcpy(s + curlen, p, len);

	sh->len = curlen + len;
	sh->free = sh->free - len;
	s[curlen + len] = '\0';

	return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5630
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10a0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x5530
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x569c
movq $0x0, -0x8(%rbp)
jmp 0x56f9
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
addq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1120
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
subq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/zmalloc.cpp
// Function: zmalloc(unsigned long)
void *zmalloc(size_t size)
{
	void *ptr = malloc(size + PREFIX_SIZE);
	if (!ptr)
		zmalloc_oom(size);
	*((size_t *)ptr) = size;
	update_zmalloc_stat_alloc(size + PREFIX_SIZE);

	return (char *)ptr + PREFIX_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x11a0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x573d
movq -0x8(%rbp), %rdi
callq 0x57c0
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x577a
movq -0x18(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, 0x4a3f(%rip)      # 0xa1c0
je 0x5799
jmp 0x5785
movq -0x18(%rbp), %rax
addq 0x4a38(%rip), %rax      # 0xa1c8
movq %rax, 0x4a31(%rip)      # 0xa1c8
jmp 0x57ab
movq -0x18(%rbp), %rax
addq 0x4a24(%rip), %rax      # 0xa1c8
movq %rax, 0x4a1d(%rip)      # 0xa1c8
jmp 0x57ad
movq -0x10(%rbp), %rax
addq $0x8, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: TTLIUJJ[P]acker_redis/zmalloc.cpp
// Function: zcalloc(unsigned long)
void *zcalloc(size_t size)
{
	void *ptr = calloc(1, size + PREFIX_SIZE);
	if (!ptr)
		zmalloc_oom(size);
	*((size_t *)ptr) = size;
	update_zmalloc_stat_add(size + PREFIX_SIZE);
	
	return (char *)ptr + PREFIX_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
movl $0x1, %edi
callq 0x1110
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5832
movq -0x8(%rbp), %rdi
callq 0x57c0
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x8, %rax
addq 0x497c(%rip), %rax      # 0xa1c8
movq %rax, 0x4975(%rip)      # 0xa1c8
movq -0x10(%rbp), %rax
addq $0x8, %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: TTLIUJJ[P]acker_redis/zmalloc.cpp
// Function: zrealloc(void*, unsigned long)
void *zrealloc(void *ptr, size_t size)
{
	void *realptr, *newptr;
	size_t old_size;

	if (ptr == NULL)
		return zmalloc(size);

	realptr = (char*)ptr - PREFIX_SIZE;
	old_size = *((size_t*)realptr);
	newptr = realloc(realptr, size + PREFIX_SIZE);
	if (!newptr)
		zmalloc_oom(size);

	*((size_t*)newptr) = size;
	update_zmalloc_stat_free(old_size);
	update_zmalloc_stat_alloc(size);

	return (char*)newptr + PREFIX_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5899
movq -0x18(%rbp), %rdi
callq 0x5710
movq %rax, -0x8(%rbp)
jmp 0x59b6
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x1200
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x58d5
movq -0x18(%rbp), %rdi
callq 0x57c0
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x590e
movq -0x38(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, 0x48ab(%rip)      # 0xa1c0
je 0x5930
jmp 0x5919
movq -0x38(%rbp), %rcx
movq 0x48a4(%rip), %rax      # 0xa1c8
subq %rcx, %rax
movq %rax, 0x489a(%rip)      # 0xa1c8
jmp 0x5945
movq -0x38(%rbp), %rcx
movq 0x488d(%rip), %rax      # 0xa1c8
subq %rcx, %rax
movq %rax, 0x4883(%rip)      # 0xa1c8
jmp 0x5947
jmp 0x5949
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x5977
movq -0x40(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, 0x4842(%rip)      # 0xa1c0
je 0x5996
jmp 0x5982
movq -0x40(%rbp), %rax
addq 0x483b(%rip), %rax      # 0xa1c8
movq %rax, 0x4834(%rip)      # 0xa1c8
jmp 0x59a8
movq -0x40(%rbp), %rax
addq 0x4827(%rip), %rax      # 0xa1c8
movq %rax, 0x4820(%rip)      # 0xa1c8
jmp 0x59aa
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
// File: TTLIUJJ[P]acker_redis/zmalloc.cpp
// Function: zmalloc_size(void*)
size_t zmalloc_size(void *ptr)
{
	void *realptr = (char *)ptr - PREFIX_SIZE;
	size_t size = *((size_t *)realptr);
	if (size & (sizeof(long) - 1))
		size += sizeof(long) - (size&(sizeof(long) - 1));

	return size + PREFIX_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x5a05
movq -0x18(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
popq %rbp
retq
nop
// File: TTLIUJJ[P]acker_redis/zmalloc.cpp
// Function: zfree(void*)
void zfree(void *ptr)
{
	void *realptr;
	size_t old_size;

	if (ptr == NULL)
		return;
	realptr = (char *)ptr - PREFIX_SIZE;
	old_size = *((size_t *)ptr);
	update_zmalloc_stat_free(old_size + PREFIX_SIZE);
	free(realptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x5a28
jmp 0x5ab3
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x5a71
movq -0x20(%rbp), %rcx
andq $0x7, %rcx
movl $0x8, %eax
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, 0x4748(%rip)      # 0xa1c0
je 0x5a93
jmp 0x5a7c
movq -0x20(%rbp), %rcx
movq 0x4741(%rip), %rax      # 0xa1c8
subq %rcx, %rax
movq %rax, 0x4737(%rip)      # 0xa1c8
jmp 0x5aa8
movq -0x20(%rbp), %rcx
movq 0x472a(%rip), %rax      # 0xa1c8
subq %rcx, %rax
movq %rax, 0x4720(%rip)      # 0xa1c8
jmp 0x5aaa
movq -0x10(%rbp), %rdi
callq 0x1180
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: TTLIUJJ[P]acker_redis/zmalloc.cpp
// Function: zmalloc_used_memmory()
size_t zmalloc_used_memmory()
{
	size_t um;
	if (zmalloc_thread_safe) {
		um = used_memory;
	}
	else
		um = used_memory;

	return um;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x46f5(%rip)      # 0xa1c0
je 0x5ada
movq 0x46f4(%rip), %rax      # 0xa1c8
movq %rax, -0x8(%rbp)
jmp 0x5ae5
movq 0x46e7(%rip), %rax      # 0xa1c8
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)