LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictRehash(dict*, int)
int dictRehash(dict *d, int n)
{
	int empty_visits = n * 10;
	if (!dictIsRehashing(d))
		return 0;
	
	while (n-- && d->ht[0].used != 0) {
		dictEntry *de, *nextde;

		assert(d->ht[0].size > (unsigned long)d->rehashidx);
		while (d->ht[0].table[d->rehashidx] == NULL) {
			++d->rehashidx;
			if (--empty_visits == 0)
				return 1;
		}
		de = d->ht[0].table[d->rehashidx];
		while (de) {
			unsigned int h;
			nextde = de->next;

			h = dictHashKey(d, de->key) & d->ht[1].size_mask;
			de->next = d->ht[1].table[h];
			d->ht[1].table[h] = de;
			--d->ht[0].used;
			++d->ht[1].used;
			de = nextde;
		}
		d->ht[0].table[d->rehashidx] = NULL;
		++d->rehashidx;
	}
	if (d->ht[0].used == 0) {
		zfree(d->ht[0].table);
		d->ht[0] = d->ht[1];
		_dictReset(&d->ht[1]);
		d->rehashidx = -1;
		return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x50(%rdi), %ecx
cmpl $-0x1, %ecx
je 0x271b
movl %esi, %r14d
movq %rdi, %rbx
imull $0xa, %esi, %r13d
leaq 0x10(%rdi), %r15
leaq 0x30(%rdi), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rdi), %rax
pushq $0x1
popq %rdx
movl %edx, 0xc(%rsp)
subl $0x1, %r14d
jb 0x26ea
testq %rax, %rax
je 0x26ef
movslq %ecx, %rcx
cmpq %rcx, 0x20(%rbx)
jbe 0x2736
leaq (,%rcx,8), %rdx
movq %r15, %rbp
addq (%r15), %rdx
incl %ecx
movl %r13d, %r13d
xorl %esi, %esi
movq (%rdx,%rsi,8), %r15
testq %r15, %r15
jne 0x2694
leal (%rcx,%rsi), %edi
movl %edi, 0x50(%rbx)
incq %rsi
cmpl %esi, %r13d
jne 0x2678
jmp 0x2723
subq %rsi, %r13
testq %r15, %r15
je 0x26cf
movq (%r15), %rdi
movq 0x10(%r15), %r12
movq (%rbx), %rax
callq *(%rax)
andl 0x48(%rbx), %eax
movq 0x30(%rbx), %rcx
movq (%rcx,%rax,8), %rdx
movq %rdx, 0x10(%r15)
movq %r15, (%rcx,%rax,8)
movq 0x18(%rbx), %rax
decq %rax
movq %rax, 0x18(%rbx)
incq 0x38(%rbx)
movq %r12, %r15
jmp 0x2697
movq 0x10(%rbx), %rcx
movslq 0x50(%rbx), %rdx
andq $0x0, (%rcx,%rdx,8)
leal 0x1(%rdx), %ecx
movl %ecx, 0x50(%rbx)
movq %rbp, %r15
jmp 0x2643
testq %rax, %rax
jne 0x2723
movq 0x10(%rbx), %rdi
callq 0x3681
movq 0x10(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
orl $-0x1, 0x50(%rbx)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2afd(%rip), %rdi      # 0x523a
leaq 0x2b22(%rip), %rsi      # 0x5266
leaq 0x2b24(%rip), %rcx      # 0x526f
movl $0xbb, %edx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/dict.cpp
// Function: dictAddRaw(dict*, void*)
dictEntry* dictAddRaw(dict *d, void *key)
{
	int index;
	dictht *ht;

	if (dictIsRehashing(d))
		_dictRehashStep(d);
	
	if ((index = _dictKeyIndex(d, key)) == -1)
		return NULL;
	
	ht = (dictIsRehashing(d)) ? &d->ht[1] : &d->ht[0];
	dictEntry *de = (dictEntry *)zmalloc(sizeof(struct dictEntry));
	de->next = ht->table[index];
	ht->table[index] = de;
	++ht->used;
	
	dictSetKey(d, de, key);
	
	return de;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $-0x1, 0x50(%rdi)
je 0x2774
movq %r14, %rdi
callq 0x25f8
movq %r14, %rdi
callq 0x2543
movq (%r14), %rax
movq %rbx, %rdi
callq *(%rax)
leaq 0x10(%r14), %r13
xorl %r15d, %r15d
movl %eax, 0x4(%rsp)
cmpq $0x2, %r15
je 0x27f6
movq %r15, %rcx
shlq $0x5, %rcx
movl 0x18(%r13,%rcx), %r12d
andl %eax, %r12d
leaq (,%r12,8), %rbp
addq (%r13,%rcx), %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x27e8
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x27d5
movq 0x8(%r14), %rdi
movq (%rbp), %rdx
movq %rbx, %rsi
callq *%rax
jmp 0x27de
xorl %eax, %eax
cmpq %rbx, (%rbp)
sete %al
addq $0x10, %rbp
testl %eax, %eax
je 0x27b1
jmp 0x284e
incq %r15
cmpl $-0x1, 0x50(%r14)
movl 0x4(%rsp), %eax
jne 0x278f
cmpl $-0x1, %r12d
je 0x284e
xorl %r15d, %r15d
cmpl $-0x1, 0x50(%r14)
setne %r15b
shll $0x5, %r15d
pushq $0x18
popq %rdi
callq 0x3564
movq %rax, %r13
movq 0x10(%r14,%r15), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, 0x10(%r13)
movq %r13, (%rax,%rcx,8)
incq 0x18(%r14,%r15)
movq (%r14), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x2848
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq *%rax
movq %rax, %rbx
movq %rbx, (%r13)
jmp 0x2851
xorl %r13d, %r13d
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x20(%rdi)
je 0x2944
movq %rsi, %rbx
movq %rdi, %r14
cmpl $-0x1, 0x50(%rdi)
je 0x28d8
movq %r14, %rdi
callq 0x25f8
leaq 0x10(%r14), %r12
movq (%r14), %rax
movq %rbx, %rdi
callq *(%rax)
movl %eax, %ebp
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x2944
movq %r13, %rax
shlq $0x5, %rax
movl 0x18(%r12,%rax), %r15d
andl %ebp, %r15d
shlq $0x3, %r15
addq (%r12,%rax), %r15
movq (%r15), %r15
testq %r15, %r15
je 0x293a
movq (%r14), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x2928
movq 0x8(%r14), %rdi
movq (%r15), %rdx
movq %rbx, %rsi
callq *%rax
jmp 0x2930
xorl %eax, %eax
cmpq %rbx, (%r15)
sete %al
testl %eax, %eax
jne 0x2947
addq $0x10, %r15
jmp 0x2906
incq %r13
cmpl $-0x1, 0x50(%r14)
jne 0x28e9
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
pushq $0x28
popq %rdi
callq 0x3564
testq %rax, %rax
je 0x2996
movq %rbx, (%rax)
andl $0x0, 0x10(%rax)
orq $-0x1, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x14(%rax)
andl $0x0, 0x24(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
leaq 0x20(%rdi), %rcx
cmpq $0x0, 0x18(%rdi)
movq %rcx, %rax
jne 0x2a26
movq (%rdi), %rdx
movq 0x8(%rdi), %rax
movl 0x10(%rdi), %esi
movslq %esi, %r9
movq %r9, %r8
shlq $0x5, %r8
addq %rdx, %r8
addq $0x10, %r8
cmpq $-0x1, %rax
sete %r10b
testl %r9d, %r9d
sete %r9b
andb %r10b, %r9b
cmpb $0x1, %r9b
jne 0x29f1
cmpl $0x0, 0x14(%rdi)
je 0x29f1
incl 0x54(%rdx)
incq %rax
movq %rax, 0x8(%rdi)
cmpq 0x10(%r8), %rax
jl 0x2a1f
xorl %eax, %eax
cmpl $-0x1, 0x50(%rdx)
je 0x2a39
testl %esi, %esi
jne 0x2a39
movl $0x1, 0x10(%rdi)
andq $0x0, 0x8(%rdi)
addq $0x30, %rdx
xorl %eax, %eax
movq %rdx, %r8
shlq $0x3, %rax
addq (%r8), %rax
movq (%rax), %rax
movq %rax, 0x18(%rdi)
testq %rax, %rax
je 0x29b5
movq 0x10(%rax), %rdx
movq %rdx, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
cmpq $-0x1, 0x8(%rdi)
jne 0x2a4b
cmpl $0x0, 0x10(%rdi)
je 0x3681
cmpl $0x0, 0x14(%rdi)
je 0x3681
movq (%rdi), %rax
decl 0x54(%rax)
jmp 0x3681
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %r13d, %r13d
cmpq 0x10(%rbx), %r13
jae 0x2c23
cmpq $0x0, 0x8(%rbx)
je 0x2c23
testq %r14, %r14
sete %al
movl %r13d, %ecx
shrl $0x10, %ecx
andl $0x1, %ecx
orb %al, %cl
jne 0x2bca
movq 0x8(%r15), %rdi
callq *%r14
movq (%rbx), %rax
movq (%rax,%r13,8), %r12
testq %r12, %r12
jne 0x2c19
jmp 0x2c1e
movq 0x10(%r12), %rbp
movq (%r15), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x2bf6
movq 0x8(%r15), %rdi
movq (%r12), %rsi
callq *%rax
movq (%r15), %rcx
movq 0x28(%rcx), %rax
testq %rax, %rax
je 0x2c0a
movq 0x8(%r15), %rdi
movq 0x8(%r12), %rsi
callq *%rax
movq %r12, %rdi
callq 0x3681
decq 0x8(%rbx)
movq %rbp, %r12
testq %r12, %r12
jne 0x2bd8
incq %r13
jmp 0x2ba3
movq (%rbx), %rdi
callq 0x3681
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0x2998
movq %rax, %r15
movb $0x53, 0x4(%rbx)
movl $0x49444552, (%rbx)     # imm = 0x49444552
addq $0x5, (%r14)
pushq $0x5
popq %rbp
movq %r15, %rdi
callq 0x29a7
testq %rax, %rax
je 0x2d00
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2d60
addq %rax, %rbp
jmp 0x2ce0
movq (%r14), %rax
movw $0x2424, (%rbx,%rax)    # imm = 0x2424
addq $0x2, (%r14)
leaq 0x2(%rbp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x2e1a
movq (%r14), %r12
addq %rbx, %r12
movq %r15, %rdi
callq 0x1090
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1110
leaq 0x2(,%rbp), %rax
addq %r13, %rax
addq (%r14), %r13
movq %r13, (%r14)
movb $0x0, (%rbx,%r13)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rax
movq (%rdi), %rdi
movq 0x8(%rax), %r15
movl (%r15), %eax
cmpl $0x3, %eax
je 0x2dcc
cmpl $0x2, %eax
je 0x2dab
cmpl $0x1, %eax
jne 0x2dfd
pushq $0x1
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2e80
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2eb6
jmp 0x2deb
pushq $0x2
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2e80
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2ebf
jmp 0x2deb
pushq $0x3
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2e80
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2f2c
addq %r12, %rax
incq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x22ed(%rip), %rdi      # 0x50f1
leaq 0x2486(%rip), %rsi      # 0x5291
leaq 0x2487(%rip), %rcx      # 0x5299
pushq $0x47
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %eax
xorl %r14d, %r14d
pushq $0xa
popq %rcx
cmpq $0xd, %r14
ja 0x2e42
testl %eax, %eax
je 0x2e42
cltd
idivl %ecx
addb $0x30, %dl
movb %dl, (%rbx,%r14)
incq %r14
jmp 0x2e29
movb $0x0, (%rbx,%r14)
movq %rbx, %rdi
callq 0x1090
cltq
addq %rbx, %rax
decq %rax
movq %rbx, %rcx
cmpq %rax, %rcx
jae 0x2e71
movb (%rcx), %dl
movb (%rax), %sil
movb %sil, (%rcx)
movb %dl, (%rax)
incq %rcx
decq %rax
jmp 0x2e5a
movw $0x2e, (%rbx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq 0x8(%rdi), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x14b4
movq %rax, %r15
movq 0x28(%r12), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x302a
movq %rax, %r12
addq %rax, (%rbx)
movq %r15, %rdi
callq 0x14e6
testq %rax, %rax
je 0x2f15
movq 0x10(%rax), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2eb6
addq %rax, %r12
jmp 0x2ef4
movq %r15, %rdi
callq 0x14e1
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq 0x8(%rdi), %r12
movq 0x38(%r12), %rdi
addq 0x18(%r12), %rdi
callq 0x302a
movq %rax, %r15
addq %rax, (%rbx)
movq %r12, %rdi
callq 0x2998
movq %rax, %r12
movq %r12, %rdi
callq 0x29a7
testq %rax, %rax
je 0x2f9c
movq (%rax), %rdi
movq 0x8(%rax), %r13
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2eb6
movq %rax, %rbp
addq %r15, %rbp
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2eb6
movq %rax, %r15
addq %rbp, %r15
jmp 0x2f61
movq %r12, %rdi
callq 0x2a3a
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsp, %r15
movq %r15, %rsi
callq 0x2e1a
movq %r15, %rdi
callq 0x1090
movq %rax, %r12
addq (%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1110
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq (%rdi), %rax
movq (%rax), %r15
movq %rsi, %rdi
callq 0x1090
cmpb $0x52, (%r14)
jne 0x30ee
cmpb $0x45, 0x1(%r14)
jne 0x30ee
cmpb $0x44, 0x2(%r14)
jne 0x30ee
cmpb $0x49, 0x3(%r14)
jne 0x30ee
cmpb $0x53, 0x4(%r14)
jne 0x30ee
movq %rax, %r12
addq $0x5, (%rbx)
xorl %r13d, %r13d
cmpq %r12, %r13
jae 0x30e4
movq (%rbx), %rax
cmpb $0x24, (%r14,%rax)
jne 0x30d1
cmpb $0x24, 0x1(%r14,%rax)
je 0x30e4
addq %rax, %r13
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3102
jmp 0x30ba
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x220f(%rip), %rdi      # 0x5304
callq 0x1120
pushq $0x1
popq %rdi
callq 0x1190
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdx), %rax
movzbl (%rsi,%rax), %ebp
incq %rax
movq %rax, (%rdx)
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x3197
movq %rax, %r14
cmpl $0x33, %ebp
je 0x3157
cmpl $0x32, %ebp
je 0x314a
cmpl $0x31, %ebp
jne 0x3178
movq %r12, %rdi
movq %r15, %rsi
callq 0x3197
jmp 0x3162
movq %r12, %rdi
movq %r15, %rsi
callq 0x31a6
jmp 0x3162
movq %r12, %rdi
movq %r15, %rsi
callq 0x320a
movq %rax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2c6c
leaq 0x1f72(%rip), %rdi      # 0x50f1
leaq 0x210b(%rip), %rsi      # 0x5291
leaq 0x2190(%rip), %rcx      # 0x531d
movl $0xfe, %edx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3b45
movq %rax, %r15
callq 0x136c
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3296
movq %rax, %r13
movq 0x8(%r15), %rax
movq %r13, 0x28(%rax)
subq $0x1, %r13
jb 0x31f9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3197
movq %r12, %rdi
movq %rax, %rsi
callq 0x138a
jmp 0x31db
movq %r12, 0x8(%r15)
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3b6b
movq %rax, %r15
leaq 0x5f46(%rip), %rdi      # 0x9170
xorl %esi, %esi
callq 0x2863
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3296
movq %rax, %r13
subq $0x1, %r13
jb 0x3271
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3197
movq %rax, %rbp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3197
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x2c6c
jmp 0x3242
movq %r12, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r12
leaq (%rdi,%r12), %r15
pushq $0x2e
popq %rsi
movq %r15, %rdi
callq 0x1080
testq %rax, %rax
je 0x32c7
movq %rax, %rcx
subq %r15, %rcx
cmpq $0xe, %rcx
jle 0x32cb
xorl %esi, %esi
jmp 0x332e
subq %rax, %r15
incq %r15
pushq $0x1
popq %rcx
testq %r15, %r15
je 0x32e2
imulq $0xa, %rcx, %rcx
incq %r15
jmp 0x32d4
incq %r12
movq %r14, %rdi
subq %rax, %rdi
xorl %esi, %esi
pushq $0xa
popq %r8
pushq $0x1
popq %r9
leaq (%rdi,%r12), %rax
cmpq $0x1, %rax
je 0x332b
movsbq -0x1(%r14,%r12), %rax
movq %r12, (%rbx)
addq $-0x30, %rax
imulq %rcx, %rax
addq %rax, %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %r8
cmpq $0xa, %rcx
movq %rax, %rcx
cmovbq %r9, %rcx
incq %r12
jmp 0x32f5
movq %r12, (%rbx)
movq %rsi, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10000, %rsp          # imm = 0x10000
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3287
movq %rax, %r15
movq (%rbx), %r13
addq %r13, %r14
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1110
addq %r15, %r13
movq %r13, (%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0x3394
addq $0x10000, %rsp          # imm = 0x10000
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9(%rsi), %rdi
testq %r14, %r14
je 0x33af
callq 0x3564
jmp 0x33b4
callq 0x35d5
movq %rax, %r15
testq %rax, %rax
je 0x33ef
testq %r14, %r14
sete %al
movl %ebx, (%r15)
andl $0x0, 0x4(%r15)
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x33e3
leaq 0x8(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1110
movb $0x0, 0x8(%r15,%rbx)
addq $0x8, %r15
jmp 0x33f2
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
movq %rdi, %rax
movl -0x4(%rdi), %ecx
cmpq %rsi, %rcx
ja 0x34fe
pushq %r14
pushq %rbx
pushq %rax
movl -0x8(%rax), %ebx
addq $-0x8, %rax
addq %rbx, %rsi
leaq (%rsi,%rsi), %rcx
movl $0x100000, %edx         # imm = 0x100000
leaq (%rsi,%rdx), %r14
cmpq %rdx, %rsi
cmovbq %rcx, %r14
leaq 0x9(%r14), %rsi
movq %rax, %rdi
callq 0x360e
testq %rax, %rax
je 0x34f5
movl %r14d, (%rax)
subl %ebx, %r14d
movl %r14d, 0x4(%rax)
addq $0x8, %rax
jmp 0x34f7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl -0x8(%rdi), %r12d
movq %rsi, %rdi
callq 0x1090
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
callq 0x34a7
movq %rax, %r15
testq %rax, %rax
je 0x3553
movq %r15, %rdi
addq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1110
movq %rbx, %rax
addq %r12, %rax
movl %eax, -0x8(%r15)
subl %ebx, -0x4(%r15)
movb $0x0, (%r15,%rax)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x11a0
testq %rax, %rax
je 0x35a4
movq %rbx, %rcx
andq $-0x8, %rcx
addq $0x10, %rcx
testb $0x7, %bl
cmoveq %r14, %rcx
addq %rcx, 0x5c1b(%rip)      # 0x91b0
movq %rbx, (%rax)
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x35ac
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x1100
testq %rax, %rax
je 0x3606
addq %r14, 0x5bb9(%rip)      # 0x91b0
movq %rbx, (%rax)
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
callq 0x35ac
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x3659
movq -0x8(%rdi), %r14
addq $-0x8, %rdi
leaq 0x8(%rbx), %rsi
callq 0x1210
testq %rax, %rax
je 0x3668
movq %rbx, (%rax)
addq $0x7, %r14
andq $-0x8, %r14
addq $0x7, %rbx
andq $-0x8, %rbx
subq %r14, %rbx
addq %rbx, 0x5b63(%rip)      # 0x91b0
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3564
movq %rbx, %rdi
callq 0x35ac
// File: /workspace/github_cpp_makefile_star2_O2/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:
testq %rdi, %rdi
je 0x36ae
movq (%rdi), %rax
addq $-0x8, %rdi
leaq 0x8(%rax), %rcx
movq %rax, %rdx
andq $-0x8, %rdx
addq $0x10, %rdx
testb $0x7, %al
cmoveq %rcx, %rdx
subq %rdx, 0x5b07(%rip)      # 0x91b0
jmp 0x1180
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/aefile.cpp
// Function: aeCreateFileEvent(int, int, int)
aeEventLoop *aeCreateFileEvent(int epollfd, int fd, int mask)
{
	aeEventLoop *el = (aeEventLoop *)zmalloc(sizeof(struct aeEventLoop));
	el->rproc = NULL;
	el->wproc = NULL;
	el->epollfd = epollfd;

	if (fd > el->maxfd)
		el->maxfd = fd;
	el->fd = fd;
	el->mask = mask;
	
	return el;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
pushq $0x20
popq %rdi
callq 0x3564
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movl %r14d, 0xc(%rax)
cmpl %ebp, (%rax)
jge 0x36dc
movl %ebp, (%rax)
movl %ebp, 0x8(%rax)
movl %ebx, 0x4(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/aefile.cpp
// Function: fileProcFromNet(aeEventLoop*, redisClient*)
void fileProcFromNet(struct aeEventLoop *el, redisClient *client)
{
	if (!(el->mask & REDIS_READABLE))
		assert(0);
	client->fd = el->fd;
	client->querybuf = (char *)malloc(REDIS_QUERY_CHUNK_BYTES * sizeof(char));
	memset(client->querybuf, 0, REDIS_QUERY_CHUNK_BYTES);
	char query[REDIS_QUERY_CHUNK_BYTES];
	size_t totlen = REDIS_QUERY_CHUNK_BYTES;
	size_t nread = 0;
	
	if((nread = read(el->fd, client->querybuf, REDIS_QUERY_CHUNK_BYTES)) == -1){
		perror("read error:");
		close(el->fd);
		delete_event(el->epollfd, el->fd, EPOLLIN);
	}
	else if(nread == 0){
		fprintf(stderr, "client close.\n");
		close(el->fd);
		delete_event(el->epollfd, el->fd, EPOLLIN);
	}
	else{
		memset(client->querybuf + nread, 0, 1);
		parseQuery(client);
		deduceCommandForQuery(client);
		modify_event(el->epollfd, el->fd, EPOLLOUT);
		free(client->querybuf);
		client->querybuf = NULL;
		el->rproc = NULL;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testb $0x1, 0x4(%rdi)
je 0x37ae
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
movl %ebp, 0x8(%rsi)
pushq $0x1
popq %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1100
movq %rax, 0x10(%r14)
movl $0x400, %edx            # imm = 0x400
movl %ebp, %edi
movq %rax, %rsi
callq 0x11d0
testq %rax, %rax
je 0x3778
cmpq $-0x1, %rax
je 0x376a
movq 0x10(%r14), %rcx
movb $0x0, (%rcx,%rax)
movq %r14, %rdi
callq 0x3c80
movq %r14, %rdi
callq 0x23e2
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edi
pushq $0x4
popq %rdx
callq 0x37ea
movq 0x10(%r14), %rdi
callq 0x1180
andq $0x0, 0x10(%r14)
andq $0x0, 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1c51(%rip), %rdi      # 0x53c2
callq 0x1120
jmp 0x3794
movq 0x5861(%rip), %rax      # 0x8fe0
movq (%rax), %rcx
leaq 0x1c45(%rip), %rdi      # 0x53ce
pushq $0xe
popq %rsi
pushq $0x1
popq %rdx
callq 0x1240
movl 0x8(%rbx), %edi
callq 0x1250
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edi
pushq $0x1
popq %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x37cb
leaq 0x193c(%rip), %rdi      # 0x50f1
leaq 0x1bc1(%rip), %rsi      # 0x537d
leaq 0x1bc5(%rip), %rcx      # 0x5388
pushq $0x24
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/aefile.cpp
// Function: fileProcIntoNet(aeEventLoop*, redisClient*)
void fileProcIntoNet(struct aeEventLoop *el, redisClient *client)
{
	if (!(el->mask & 2))
		assert(0);
		
	client->fd = el->fd;
	size_t nwrite = 0;

	memcpy(client->buf+client->bufpos, "\n", 1);
	++client->bufpos;
	if((nwrite = write(el->fd, client->buf, client->bufpos)) == -1){
		perror("write error: ");
		close(el->fd);
		delete_event(el->epollfd, el->fd, EPOLLOUT);
	}
	else{
		modify_event(el->epollfd, el->fd, EPOLLIN);
		memset(client->buf, 0, client->bufpos);
		client->bufpos = 0;
		el->wproc = NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testb $0x2, 0x4(%rdi)
je 0x389f
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rdi), %eax
movl %eax, 0x8(%rsi)
leaq 0x34(%rsi), %r15
movslq 0x30(%rsi), %rax
movb $0xa, 0x34(%rsi,%rax)
movslq 0x30(%rsi), %rdx
incq %rdx
movl %edx, 0x30(%rsi)
movl 0x8(%rdi), %edi
movq %r15, %rsi
callq 0x1070
cmpq $-0x1, %rax
je 0x3878
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edi
pushq $0x1
popq %rdx
callq 0x37ea
movslq 0x30(%r14), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x10d0
andl $0x0, 0x30(%r14)
andq $0x0, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1b98(%rip), %rdi      # 0x5417
callq 0x1120
movl 0x8(%rbx), %edi
callq 0x1250
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edi
pushq $0x4
popq %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x37cb
leaq 0x184b(%rip), %rdi      # 0x50f1
leaq 0x1ad0(%rip), %rsi      # 0x537d
leaq 0x1b29(%rip), %rcx      # 0x53dd
pushq $0x46
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/db.cpp
// Function: dbModifyStringVal(redisDb*, void*, void*)
int dbModifyStringVal(redisDb *db, void *key, void *val)
{
	dict *d = db->dict;
	dictEntry *de = dictFind(d, key);
	if (de == NULL) 
		return REDIS_ERR;

	robj *old_val = (robj *)de->val;
	robj *new_val = (robj *)val;
	if (keyStringObjectCompare(NULL, old_val, new_val))
		return REDIS_ERR;

	decrRefCount(old_val);
	de->val = new_val;

	return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq (%rdi), %rdi
callq 0x28ae
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x3924
movq %rax, %r14
movq 0x8(%rax), %r15
xorl %edi, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3ae0
testl %eax, %eax
jne 0x3924
movq %r15, %rdi
callq 0x3c29
movq %rbx, 0x8(%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/db.cpp
// Function: removeHashEntry(dict*, void*, void*)
void removeHashEntry(dict *d, void *key, void *val)
{
	unsigned int h, idx, table;
	dictEntry *cur, *prev;
	int decr = 0;
	h = (d->type->hashFunction)(key);
	for (table = 0; table < 2; ++table) {
		idx = h & d->ht[table].size_mask;
		cur = d->ht[table].table[idx];
		prev = NULL;
		if (cur != NULL) {
			if (dictCompareKeys(d, key, cur->key)) {
				d->ht[table].table[idx] = cur->next;
				decr = 1;
				break;
			}
			prev = cur;
			cur = cur->next;
		}
		while (cur != NULL) {
			if (dictCompareKeys(d, key, cur->key)) {
				prev->next = cur->next;
				decr = 1;
				break;
			}
			prev = cur;
			cur = cur->next;
		}
		if (dictIsRehashing(d))
			break;
	}
	if (decr) {
		--d->ht[table].used;
		decrRefCountVoid(key);
		decrRefCountVoid(val);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movq %rsi, %rdi
callq *(%rax)
movl %eax, 0x1c(%rsp)
leaq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
movl $0x0, 0xc(%rsp)
cmpq $0x2, %rbp
je 0x3a1c
movq %rbp, %r13
shlq $0x5, %r13
movq 0x10(%rsp), %rax
movl 0x18(%rax,%r13), %r12d
andl 0x1c(%rsp), %r12d
movq (%rax,%r13), %rax
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0x39b8
movq (%r15), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x39bc
movq 0x8(%r15), %rdi
movq (%rbx), %rdx
movq %r14, %rsi
callq *%rax
jmp 0x39c4
xorl %ecx, %ecx
jmp 0x39cc
xorl %eax, %eax
cmpq %r14, (%rbx)
sete %al
movq 0x10(%rbx), %rcx
testl %eax, %eax
jne 0x3a32
testq %rcx, %rcx
je 0x3a0d
movq %rbx, %r12
movq %rcx, %rbx
movq (%r15), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x39f1
movq 0x8(%r15), %rdi
movq (%rbx), %rdx
movq %r14, %rsi
callq *%rax
jmp 0x39f9
xorl %eax, %eax
cmpq %r14, (%rbx)
sete %al
movq 0x10(%rbx), %rcx
testl %eax, %eax
je 0x39cc
movq %rcx, 0x10(%r12)
pushq $0x1
popq %rax
movl %eax, 0xc(%rsp)
cmpl $-0x1, 0x50(%r15)
jne 0x3a1c
incq %rbp
jmp 0x3971
cmpl $0x0, 0xc(%rsp)
jne 0x3a3f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq 0x10(%rsp), %r13
movq (%r13), %rax
movq %rcx, (%rax,%r12,8)
movl %ebp, %eax
shlq $0x5, %rax
movq 0x10(%rsp), %rcx
decq 0x8(%rcx,%rax)
movq %r14, %rdi
callq 0x3b66
movq 0x20(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3b66
nop
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: dictStringObjectHashFuction(void const*)
unsigned int dictStringObjectHashFuction(const void *key)
{	
	const char *p = (sds)((robj *)key)->ptr;

	unsigned int hash = (unsigned int)dict_hash_function_seed;
	unsigned len = strlen(p);
	while (len--) {
		hash = ((hash << 5) + hash) + (tolower(*p++));
	}

	return hash;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x1090
movq %rax, %r14
movl $0x1505, %eax           # imm = 0x1505
xorl %r15d, %r15d
cmpl %r15d, %r14d
je 0x3aa7
imull $0x21, %eax, %ebp
movsbl (%rbx,%r15), %edi
callq 0x11e0
addl %ebp, %eax
incq %r15
jmp 0x3a8e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: stringObjectDup(void*, void const*)
void *stringObjectDup(void *pirvdata, const void *key)
{
	assert(((robj *)key)->type == REDIS_STRING);
	
	char *s = (char *)(((robj *)key)->ptr);
	robj *k = createStringObject(s);

	return k;
}

// Assembly:
cmpl $0x1, (%rsi)
jne 0x3ac0
movq 0x8(%rsi), %rdi
jmp 0x3b33
pushq %rax
leaq 0x1a22(%rip), %rdi      # 0x54ea
leaq 0x1970(%rip), %rsi      # 0x543f
leaq 0x1a38(%rip), %rcx      # 0x550e
movl $0x8b, %edx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: createObject(int, void*)
robj *createObject(int type, void *ptr)
{
	robj *o = (robj *)zmalloc(sizeof(robj));
	o->type = type;
	o->ptr = ptr;
	o->refcount = 1;

	return o;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x10
popq %rdi
callq 0x3564
movl %ebp, (%rax)
movq %rbx, 0x8(%rax)
movl $0x1, 0x4(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: createListObject()
robj *createListObject()
{
	list *l = listCreate();
	robj *o = createObject(REDIS_LIST, l);
	listSetFreeMethod(l, decrRefCountVoid);

	return o;
}

// Assembly:
pushq %rbx
callq 0x136c
movq %rax, %rbx
pushq $0x2
popq %rdi
movq %rax, %rsi
callq 0x3b0f
leaq 0x6(%rip), %rcx         # 0x3b66
movq %rcx, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: freeStringObject(void*)
void freeStringObject(void *o) 
{
	robj *val = (robj *)o;
	assert(val->type == REDIS_STRING);
	sdsFree((sds)val->ptr);
	zfree(val);
}

// Assembly:
pushq %rbx
cmpl $0x1, (%rdi)
jne 0x3b9c
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x343f
movq %rbx, %rdi
popq %rbx
jmp 0x3681
leaq 0x1882(%rip), %rdi      # 0x5425
leaq 0x1895(%rip), %rsi      # 0x543f
leaq 0x1899(%rip), %rcx      # 0x544a
pushq $0x32
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: freeListObject(void*)
void freeListObject(void *o)
{
	robj *val = (robj *)o;
	assert(val->type == REDIS_LIST);
	listRelease((list *)val->ptr);
	zfree(val);
}

// Assembly:
pushq %rbx
cmpl $0x2, (%rdi)
jne 0x3bd4
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x158b
movq %rbx, %rdi
popq %rbx
jmp 0x3681
leaq 0x188d(%rip), %rdi      # 0x5468
leaq 0x185d(%rip), %rsi      # 0x543f
leaq 0x1897(%rip), %rcx      # 0x5480
pushq $0x3a
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: freeHashObject(void*)
void freeHashObject(void *o)
{
	robj *val = (robj *)o;
	assert(val->type == REDIS_HASH);
	dictRelease((dict *)val->ptr);
	zfree(val);
}

// Assembly:
pushq %rbx
cmpl $0x3, (%rdi)
jne 0x3c0c
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2c46
movq %rbx, %rdi
popq %rbx
jmp 0x3681
leaq 0x1889(%rip), %rdi      # 0x549c
leaq 0x1825(%rip), %rsi      # 0x543f
leaq 0x1893(%rip), %rcx      # 0x54b4
pushq $0x42
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/object.cpp
// Function: decrRefCount(redisObject*)
void decrRefCount(robj *o)
{
	
	if (o->refcount > 1) {
		--o->refcount;
	}
	else if (o->refcount == 1) {
		switch (o->type) {
		case REDIS_STRING:
			freeStringObject(o);
			break;
		case REDIS_LIST:
			freeListObject(o);
			break;
		case REDIS_HASH:
			freeHashObject(o);
			break;
		default:
			assert(0);
		}
	}
}

// Assembly:
movl 0x4(%rdi), %eax
cmpl $0x2, %eax
jl 0x3c38
decl %eax
movl %eax, 0x4(%rdi)
jmp 0x3c5b
cmpl $0x1, %eax
jne 0x3c5b
movl (%rdi), %eax
cmpl $0x3, %eax
je 0x3bf1
cmpl $0x2, %eax
je 0x3bb9
cmpl $0x1, %eax
jne 0x3c5c
jmp 0x3b81
retq
pushq %rax
leaq 0x148d(%rip), %rdi      # 0x50f1
leaq 0x17d4(%rip), %rsi      # 0x543f
leaq 0x185e(%rip), %rcx      # 0x54d0
pushq $0x59
popq %rdx
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/redis.cpp
// Function: parseQuery(redisClient*)
void parseQuery(redisClient *client)
{
	size_t pos = 0;
	int argc = 0;
	int i = 0;
	size_t diff;
	size_t buflen = strlen(client->querybuf);
	//as far as I known, it will receive the 127 ASCII at first correspondence, so the 10 and ASCII must be deleted 	
	//and the last correspondence we just exclude the 10 ASCII
	//and it may be includes other situations beyond i known.
	//so in the loop more charcters are comsidered.
	char *p = client->querybuf + buflen;
	for(i = 1; i < 10; ++i){
		--p;
		if(*p == '\n')
			break;
	}
	buflen -= i;
	memset(client->querybuf + buflen, 0, 1);
	while (pos < buflen) {
		char *p = strchr(client->querybuf + pos, ' ');
		robj *o;
	
		if (p == NULL) {
			diff = buflen - pos;
			o = parseQueryObject(client->querybuf, &pos, diff);
		}
		else {
			diff = p - (client->querybuf + pos);
			if (diff == 0) {
				++pos;
				continue;
			}
			o = parseQueryObject(client->querybuf, &pos, diff);
			//for skip ' '
			++pos;
		}
		client->argv[argc] = o;
		++argc;
	}
	client->argc = argc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
andq $0x0, (%rsp)
movq %rdi, 0x10(%rsp)
movq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x1090
addq %rax, %r14
pushq $0x1
popq %rbp
subq %rax, %rbp
pushq $-0x1
popq %rax
cmpl $-0xa, %eax
je 0x3cc4
cmpb $0xa, (%r14,%rax)
je 0x3cc4
incq %rbp
decq %rax
jmp 0x3cb0
negq %rbp
movb $0x0, (%r14,%rax)
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
movq (%rsp), %rbx
movq %rbp, %r15
subq %r14, %r15
cmpq %rbp, %r14
jae 0x3d70
movq 0x10(%rsp), %rax
movq 0x10(%rax), %r12
leaq (%r12,%r14), %r13
movq %r13, %rdi
pushq $0x20
popq %rsi
callq 0x1080
testq %rax, %rax
je 0x3d17
cmpq %rax, %r13
jne 0x3d2f
incq %r14
decq %r15
movq %r14, %rbx
jmp 0x3ce1
movq %rbx, (%rsp)
movq %r12, %rdi
movq %rsp, %rsi
movq %r15, %rdx
callq 0x3d8f
movq (%rsp), %r14
jmp 0x3d52
movq %rbx, (%rsp)
subq %r12, %rax
subq %r14, %rax
movq %r12, %rdi
movq %rsp, %rsi
movq %rax, %rdx
callq 0x3d8f
movq (%rsp), %r14
incq %r14
movq %r14, (%rsp)
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rcx
movl 0xc(%rsp), %esi
movl %esi, %edx
movq %rax, (%rcx,%rdx,8)
incl %esi
movl %esi, 0xc(%rsp)
jmp 0x3cd7
movq %rbx, (%rsp)
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, 0x18(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/TTLIUJJ[P]acker_redis/redis.cpp
// Function: parseQueryObject(char*, unsigned long*, unsigned long)
static robj* parseQueryObject(char *buf, size_t *pos, size_t slen)
{
	char query[MAXQUERY];
	memcpy(query, buf + *pos, slen);
	query[slen] = '\0';
	*pos += slen;
	robj *o = createStringObject(query);

	return o;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdx, %rbx
movq %rsi, %r14
movq (%rsi), %r12
leaq (%rdi,%r12), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x1110
movb $0x0, (%rsp,%rbx)
addq %rbx, %r12
movq %r12, (%r14)
movq %r15, %rdi
callq 0x3b33
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq