LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeTryConversion
void hashTypeTryConversion(robj *o, robj **argv, int start, int end) {
    int i;

    // 如果对象不是 ziplist 编码，那么直接返回
    if (o->encoding != REDIS_ENCODING_ZIPLIST) return;

    // 检查所有输入对象，看它们的字符串值是否超过了指定长度
    for (i = start; i <= end; i++) {
        if (sdsEncodedObject(argv[i]) &&
            sdslen(argv[i]->ptr) > server.hash_max_ziplist_value)
        {
            // 将对象的编码转换成 REDIS_ENCODING_HT
            hashTypeConvert(o, REDIS_ENCODING_HT);
            break;
        }
    }
}

// Assembly:
movl $0xf0, %eax
andl (%rdi), %eax
cmpl $0x50, %eax
setne %al
cmpl %ecx, %edx
setg %r8b
orb %al, %r8b
jne 0x42178
leaq 0x87e69(%rip), %rax     # 0xc9fa8
movq 0x760(%rax), %rax
movslq %edx, %r8
leaq (%rsi,%r8,8), %rsi
subl %edx, %ecx
incl %ecx
xorl %edx, %edx
movq (%rsi,%rdx,8), %r8
movl (%r8), %r9d
shrl $0x4, %r9d
testb $0x7, %r9b
jne 0x42171
movq 0x8(%r8), %r8
movslq -0x8(%r8), %r8
cmpq %r8, %rax
jb 0x42179
incq %rdx
cmpl %edx, %ecx
jne 0x42153
retq
movl $0x2, %esi
jmp 0x42183
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeConvert
void hashTypeConvert(robj *o, int enc) {

    if (o->encoding == REDIS_ENCODING_ZIPLIST) {
        hashTypeConvertZiplist(o, enc);

    } else if (o->encoding == REDIS_ENCODING_HT) {
        redisPanic("Not implemented");

    } else {
        redisPanic("Unknown hash encoding");
    }
}

// Assembly:
pushq %rax
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
jne 0x42197
popq %rax
jmp 0x42aa3
cmpl $0x2, %eax
jne 0x421b1
leaq 0x574de(%rip), %rdi     # 0x99681
leaq 0x57418(%rip), %rsi     # 0x995c2
movl $0x2b6, %edx            # imm = 0x2B6
jmp 0x421c4
leaq 0x56957(%rip), %rdi     # 0x98b0f
leaq 0x57403(%rip), %rsi     # 0x995c2
movl $0x2b9, %edx            # imm = 0x2B9
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeGetFromZiplist
int hashTypeGetFromZiplist(robj *o, robj *field,
                           unsigned char **vstr,
                           unsigned int *vlen,
                           long long *vll)
{
    unsigned char *zl, *fptr = NULL, *vptr = NULL;
    int ret;

    // 确保编码正确
    redisAssert(o->encoding == REDIS_ENCODING_ZIPLIST);

    // 取出未编码的域
    field = getDecodedObject(field);

    // 遍历 ziplist ，查找域的位置
    zl = o->ptr;
    fptr = ziplistIndex(zl, ZIPLIST_HEAD);
    if (fptr != NULL) {
        // 定位包含域的节点
        fptr = ziplistFind(fptr, field->ptr, sdslen(field->ptr), 1);
        if (fptr != NULL) {
            /* Grab pointer to the value (fptr points to the field) */
            // 域已经找到，取出和它相对应的值的位置
            vptr = ziplistNext(zl, fptr);
            redisAssert(vptr != NULL);
        }
    }

    decrRefCount(field);

    // 从 ziplist 节点中取出值
    if (vptr != NULL) {
        ret = ziplistGet(vptr, vstr, vlen, vll);
        redisAssert(ret);
        return 0;
    }

    // 没找到
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0xf0, %eax
andl (%rdi), %eax
cmpl $0x50, %eax
jne 0x422ce
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r13
movq %rsi, %rdi
callq 0x30d93
movq %rax, %r12
movq 0x8(%r13), %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x2c28b
testq %rax, %rax
je 0x422b7
movq 0x8(%r12), %rsi
movl -0x8(%rsi), %edx
movq %rax, %rdi
movl $0x1, %ecx
callq 0x2ca1a
testq %rax, %rax
je 0x422b7
movq %r13, %rdi
movq %rax, %rsi
callq 0x2c558
testq %rax, %rax
je 0x422e3
movq %rax, %r13
movq %r12, %rdi
callq 0x30b0c
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2c5f6
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x422c4
leaq 0x5732f(%rip), %rdi     # 0x995d8
leaq 0x57312(%rip), %rsi     # 0x995c2
movl $0x7e, %edx
jmp 0x422f6
movq %r12, %rdi
callq 0x30b0c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x572c7(%rip), %rdi     # 0x9959c
leaq 0x572e6(%rip), %rsi     # 0x995c2
movl $0x66, %edx
jmp 0x422f6
leaq 0x572e1(%rip), %rdi     # 0x995cb
leaq 0x572d1(%rip), %rsi     # 0x995c2
movl $0x75, %edx
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeGetFromHashTable
int hashTypeGetFromHashTable(robj *o, robj *field, robj **value) {
    dictEntry *de;

    // 确保编码正确
    redisAssert(o->encoding == REDIS_ENCODING_HT);

    // 在字典中查找域（键）
    de = dictFind(o->ptr, field);

    // 键不存在
    if (de == NULL) return -1;

    // 取出域（键）的值
    *value = dictGetVal(de);

    // 成功找到
    return 0;
}

// Assembly:
pushq %rbx
movl $0xf0, %eax
andl (%rdi), %eax
cmpl $0x20, %eax
jne 0x42335
movq %rdx, %rbx
movq 0x8(%rdi), %rdi
callq 0x226ac
testq %rax, %rax
je 0x4232e
movq 0x8(%rax), %rax
movq %rax, (%rbx)
xorl %eax, %eax
jmp 0x42333
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
leaq 0x572a0(%rip), %rdi     # 0x995dc
leaq 0x5727f(%rip), %rsi     # 0x995c2
movl $0x91, %edx
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeGetObject
robj *hashTypeGetObject(robj *o, robj *field) {
    robj *value = NULL;

    // 从 ziplist 中取出值
    if (o->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *vstr = NULL;
        unsigned int vlen = UINT_MAX;
        long long vll = LLONG_MAX;

        if (hashTypeGetFromZiplist(o, field, &vstr, &vlen, &vll) == 0) {
            // 创建值对象
            if (vstr) {
                value = createStringObject((char*)vstr, vlen);
            } else {
                value = createStringObjectFromLongLong(vll);
            }
        }

    // 从字典中取出值
    } else if (o->encoding == REDIS_ENCODING_HT) {
        robj *aux;

        if (hashTypeGetFromHashTable(o, field, &aux) == 0) {
            incrRefCount(aux);
            value = aux;
        }

    } else {
        redisPanic("Unknown hash encoding");
    }

    // 返回值对象，或者 NULL
    return value;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x423b5
cmpl $0x5, %eax
jne 0x423ec
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x14(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
callq 0x42211
testl %eax, %eax
jne 0x423c3
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x423d6
movl 0x14(%rsp), %esi
callq 0x3068f
jmp 0x423e0
leaq 0x8(%rsp), %rdx
callq 0x42305
testl %eax, %eax
je 0x423c7
xorl %ebx, %ebx
jmp 0x423e3
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x306f3
jmp 0x423e3
movq 0x18(%rsp), %rdi
callq 0x3069e
movq %rax, %rbx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq
leaq 0x5671c(%rip), %rdi     # 0x98b0f
leaq 0x571c8(%rip), %rsi     # 0x995c2
movl $0xc7, %edx
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeExists
int hashTypeExists(robj *o, robj *field) {

    // 检查 ziplist
    if (o->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *vstr = NULL;
        unsigned int vlen = UINT_MAX;
        long long vll = LLONG_MAX;

        if (hashTypeGetFromZiplist(o, field, &vstr, &vlen, &vll) == 0) return 1;

    // 检查字典
    } else if (o->encoding == REDIS_ENCODING_HT) {
        robj *aux;

        if (hashTypeGetFromHashTable(o, field, &aux) == 0) return 1;

    // 未知编码
    } else {
        redisPanic("Unknown hash encoding");
    }

    // 不存在
    return 0;
}

// Assembly:
subq $0x18, %rsp
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x42452
cmpl $0x5, %eax
jne 0x4246c
movq %rsp, %rdx
movq $0x0, (%rdx)
leaq 0xc(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x10(%rsp), %r8
movq %rax, (%r8)
callq 0x42211
jmp 0x4245a
movq %rsp, %rdx
callq 0x42305
testl %eax, %eax
je 0x42462
xorl %eax, %eax
jmp 0x42467
movl $0x1, %eax
addq $0x18, %rsp
retq
leaq 0x5669c(%rip), %rdi     # 0x98b0f
leaq 0x57148(%rip), %rsi     # 0x995c2
movl $0xe7, %edx
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeLength
unsigned long hashTypeLength(robj *o) {
    unsigned long length = ULONG_MAX;

    if (o->encoding == REDIS_ENCODING_ZIPLIST) {
        // ziplist 中，每个 field-value 对都需要使用两个节点来保存
        length = ziplistLen(o->ptr) / 2;
    } else if (o->encoding == REDIS_ENCODING_HT) {
        length = dictSize((dict*)o->ptr);
    } else {
        redisPanic("Unknown hash encoding");
    }

    return length;
}

// Assembly:
pushq %rax
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x4263c
cmpl $0x5, %eax
jne 0x4264a
movq 0x8(%rdi), %rdi
callq 0x2cc17
shrl %eax
jmp 0x42648
movq 0x8(%rdi), %rcx
movq 0x48(%rcx), %rax
addq 0x28(%rcx), %rax
popq %rcx
retq
leaq 0x564be(%rip), %rdi     # 0x98b0f
leaq 0x56f6a(%rip), %rsi     # 0x995c2
movl $0x188, %edx            # imm = 0x188
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeDelete
int hashTypeDelete(robj *o, robj *field) {
    int deleted = 0;

    // 从 ziplist 中删除
    if (o->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *zl, *fptr;

        field = getDecodedObject(field);

        zl = o->ptr;
        fptr = ziplistIndex(zl, ZIPLIST_HEAD);
        if (fptr != NULL) {
            // 定位到域
            fptr = ziplistFind(fptr, field->ptr, sdslen(field->ptr), 1);
            if (fptr != NULL) {
                // 删除域和值
                zl = ziplistDelete(zl,&fptr);
                zl = ziplistDelete(zl,&fptr);
                o->ptr = zl;
                deleted = 1;
            }
        }

        decrRefCount(field);

    // 从字典中删除
    } else if (o->encoding == REDIS_ENCODING_HT) {
        if (dictDelete((dict*)o->ptr, field) == REDIS_OK) {
            deleted = 1;

            /* Always check if the dictionary needs a resize after a delete. */
            // 删除成功时，看字典是否需要收缩
            if (htNeedsResize(o->ptr)) dictResize(o->ptr);
        }

    } else {
        redisPanic("Unknown hash encoding");
    }

    return deleted;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x42702
cmpl $0x5, %eax
jne 0x4273b
movq %rsi, %rdi
callq 0x30d93
movq %rax, %r14
movq 0x8(%rbx), %r15
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
callq 0x2c28b
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x426f8
movq 0x8(%r14), %rsi
movl -0x8(%rsi), %edx
movq %rax, %rdi
movl $0x1, %ecx
callq 0x2ca1a
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x426f8
leaq 0x8(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x2c713
movq %rax, %rdi
movq %r12, %rsi
callq 0x2c713
movq %rax, 0x8(%rbx)
movl $0x1, %ebp
movq %r14, %rdi
callq 0x30b0c
jmp 0x4272c
movq 0x8(%rbx), %rdi
callq 0x22796
xorl %ebp, %ebp
testl %eax, %eax
jne 0x4272c
movq 0x8(%rbx), %rdi
callq 0x2363c
movl $0x1, %ebp
testl %eax, %eax
je 0x4272c
movq 0x8(%rbx), %rdi
callq 0x221ba
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x563cd(%rip), %rdi     # 0x98b0f
leaq 0x56e79(%rip), %rsi     # 0x995c2
movl $0x175, %edx            # imm = 0x175
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeInitIterator
hashTypeIterator *hashTypeInitIterator(robj *subject) {

    hashTypeIterator *hi = zmalloc(sizeof(hashTypeIterator));

    // 指向对象
    hi->subject = subject;

    // 记录编码
    hi->encoding = subject->encoding;

    // 以 ziplist 的方式初始化迭代器
    if (hi->encoding == REDIS_ENCODING_ZIPLIST) {
        hi->fptr = NULL;
        hi->vptr = NULL;

    // 以字典的方式初始化迭代器
    } else if (hi->encoding == REDIS_ENCODING_HT) {
        hi->di = dictGetIterator(subject->ptr);

    } else {
        redisPanic("Unknown hash encoding");
    }

    // 返回迭代器
    return hi;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x30, %edi
callq 0x299b5
movq %rax, %rbx
movq %r14, (%rax)
movl (%r14), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, 0x8(%rbx)
cmpl $0x2, %eax
je 0x42793
cmpl $0x5, %eax
jne 0x427ab
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
jmp 0x427a0
movq 0x8(%r14), %rdi
callq 0x22a71
movq %rax, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5635d(%rip), %rdi     # 0x98b0f
leaq 0x56e09(%rip), %rsi     # 0x995c2
movl $0x1ab, %edx            # imm = 0x1AB
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeReleaseIterator
void hashTypeReleaseIterator(hashTypeIterator *hi) {

    // 释放字典迭代器
    if (hi->encoding == REDIS_ENCODING_HT) {
        dictReleaseIterator(hi->di);
    }

    // 释放 ziplist 迭代器
    zfree(hi);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x2, 0x8(%rdi)
jne 0x427e0
movq 0x20(%rbx), %rdi
callq 0x22b86
movq %rbx, %rdi
popq %rbx
jmp 0x29af7
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeNext
int hashTypeNext(hashTypeIterator *hi) {

    // 迭代 ziplist
    if (hi->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *zl;
        unsigned char *fptr, *vptr;

        zl = hi->subject->ptr;
        fptr = hi->fptr;
        vptr = hi->vptr;

        // 第一次执行时，初始化指针
        if (fptr == NULL) {
            /* Initialize cursor */
            redisAssert(vptr == NULL);
            fptr = ziplistIndex(zl, 0);

        // 获取下一个迭代节点
        } else {
            /* Advance cursor */
            redisAssert(vptr != NULL);
            fptr = ziplistNext(zl, vptr);
        }

        // 迭代完毕，或者 ziplist 为空
        if (fptr == NULL) return REDIS_ERR;

        /* Grab pointer to the value (fptr points to the field) */
        // 记录值的指针
        vptr = ziplistNext(zl, fptr);
        redisAssert(vptr != NULL);

        /* fptr, vptr now point to the first or next pair */
        // 更新迭代器指针
        hi->fptr = fptr;
        hi->vptr = vptr;

    // 迭代字典
    } else if (hi->encoding == REDIS_ENCODING_HT) {
        if ((hi->de = dictNext(hi->di)) == NULL) return REDIS_ERR;

    // 未知编码
    } else {
        redisPanic("Unknown hash encoding");
    }

    // 迭代成功
    return REDIS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpl $0x2, %eax
je 0x4281f
cmpl $0x5, %eax
jne 0x42871
movq (%rbx), %rax
movq 0x18(%rbx), %rsi
movq 0x8(%rax), %r14
cmpq $0x0, 0x10(%rbx)
je 0x42833
testq %rsi, %rsi
je 0x4288b
movq %r14, %rdi
callq 0x2c558
jmp 0x42842
movq 0x20(%rbx), %rdi
callq 0x22acf
movq %rax, 0x28(%rbx)
testq %rax, %rax
jne 0x42862
jmp 0x42866
testq %rsi, %rsi
jne 0x428b5
movq %r14, %rdi
xorl %esi, %esi
callq 0x2c28b
movq %rax, %r15
testq %rax, %rax
je 0x42866
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c558
testq %rax, %rax
je 0x428a0
movq %r15, 0x10(%rbx)
movq %rax, 0x18(%rbx)
xorl %eax, %eax
jmp 0x4286b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
leaq 0x56297(%rip), %rdi     # 0x98b0f
leaq 0x56d43(%rip), %rsi     # 0x995c2
movl $0x1f5, %edx            # imm = 0x1F5
callq 0x4cae0
jmp 0x428cd
leaq 0x56d39(%rip), %rdi     # 0x995cb
leaq 0x56d29(%rip), %rsi     # 0x995c2
movl $0x1de, %edx            # imm = 0x1DE
jmp 0x428c8
leaq 0x56d24(%rip), %rdi     # 0x995cb
leaq 0x56d14(%rip), %rsi     # 0x995c2
movl $0x1e8, %edx            # imm = 0x1E8
jmp 0x428c8
leaq 0x56d41(%rip), %rdi     # 0x995fd
leaq 0x56cff(%rip), %rsi     # 0x995c2
movl $0x1d8, %edx            # imm = 0x1D8
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeCurrentFromZiplist
void hashTypeCurrentFromZiplist(hashTypeIterator *hi, int what,
                                unsigned char **vstr,
                                unsigned int *vlen,
                                long long *vll)
{
    int ret;

    // 确保编码正确
    redisAssert(hi->encoding == REDIS_ENCODING_ZIPLIST);

    // 取出键
    if (what & REDIS_HASH_KEY) {
        ret = ziplistGet(hi->fptr, vstr, vlen, vll);
        redisAssert(ret);

    // 取出值
    } else {
        ret = ziplistGet(hi->vptr, vstr, vlen, vll);
        redisAssert(ret);
    }
}

// Assembly:
pushq %rax
cmpl $0x5, 0x8(%rdi)
jne 0x42927
testb $0x1, %sil
jne 0x4290f
movq 0x18(%rdi), %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x2c5f6
testl %eax, %eax
jne 0x42925
leaq 0x56cd7(%rip), %rdi     # 0x995d8
leaq 0x56cba(%rip), %rsi     # 0x995c2
movl $0x213, %edx            # imm = 0x213
jmp 0x4294f
movq 0x10(%rdi), %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x2c5f6
testl %eax, %eax
je 0x4293c
popq %rax
retq
leaq 0x56cdc(%rip), %rdi     # 0x9960a
leaq 0x56c8d(%rip), %rsi     # 0x995c2
movl $0x209, %edx            # imm = 0x209
jmp 0x4294f
leaq 0x56c95(%rip), %rdi     # 0x995d8
leaq 0x56c78(%rip), %rsi     # 0x995c2
movl $0x20e, %edx            # imm = 0x20E
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeCurrentObject
robj *hashTypeCurrentObject(hashTypeIterator *hi, int what) {
    robj *dst;

    // ziplist
    if (hi->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *vstr = NULL;
        unsigned int vlen = UINT_MAX;
        long long vll = LLONG_MAX;

        // 取出键或值
        hashTypeCurrentFromZiplist(hi, what, &vstr, &vlen, &vll);

        // 创建键或值的对象
        if (vstr) {
            dst = createStringObject((char*)vstr, vlen);
        } else {
            dst = createStringObjectFromLongLong(vll);
        }

    // 字典
    } else if (hi->encoding == REDIS_ENCODING_HT) {
        // 取出键或者值
        hashTypeCurrentFromHashTable(hi, what, &dst);
        // 对对象的引用计数进行自增
        incrRefCount(dst);

    // 未知编码
    } else {
        redisPanic("Unknown hash encoding");
    }

    // 返回对象
    return dst;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl 0x8(%rdi), %eax
cmpl $0x2, %eax
je 0x429f3
cmpl $0x5, %eax
jne 0x42a23
leaq 0x18(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0xc(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x10(%rsp), %r8
movq %rax, (%r8)
movq %rbx, %rdx
callq 0x428d7
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x42a0d
movl 0xc(%rsp), %esi
callq 0x3068f
jmp 0x42a17
leaq 0x18(%rsp), %rbx
movq %rbx, %rdx
callq 0x4295e
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x306f3
jmp 0x42a1a
movq 0x10(%rsp), %rdi
callq 0x3069e
movq %rax, %rbx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
retq
leaq 0x560e5(%rip), %rdi     # 0x98b0f
leaq 0x56b91(%rip), %rsi     # 0x995c2
movl $0x250, %edx            # imm = 0x250
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeLookupWriteOrCreate
robj *hashTypeLookupWriteOrCreate(redisClient *c, robj *key) {

    robj *o = lookupKeyWrite(c->db,key);

    // 对象不存在，创建新的
    if (o == NULL) {
        o = createHashObject();
        dbAdd(c->db,key,o);

    // 对象存在，检查类型
    } else {
        if (o->type != REDIS_HASH) {
            addReply(c,shared.wrongtypeerr);
            return NULL;
        }
    }

    // 返回对象
    return o;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x31724
testq %rax, %rax
je 0x42a83
movq %rax, %r14
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
je 0x42a9a
leaq 0x87d8e(%rip), %rax     # 0xca800
movq 0x70(%rax), %rsi
movq %rbx, %rdi
callq 0x2d97c
xorl %r14d, %r14d
jmp 0x42a9a
callq 0x30911
movq %rax, %r14
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x317f0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeConvertZiplist
void hashTypeConvertZiplist(robj *o, int enc) {
    redisAssert(o->encoding == REDIS_ENCODING_ZIPLIST);

    // 如果输入是 ZIPLIST ，那么不做动作
    if (enc == REDIS_ENCODING_ZIPLIST) {
        /* Nothing to do... */

    // 转换成 HT 编码
    } else if (enc == REDIS_ENCODING_HT) {

        hashTypeIterator *hi;
        dict *dict;
        int ret;

        // 创建哈希迭代器
        hi = hashTypeInitIterator(o);

        // 创建空白的新字典
        dict = dictCreate(&hashDictType, NULL);

        // 遍历整个 ziplist
        while (hashTypeNext(hi) != REDIS_ERR) {
            robj *field, *value;

            // 取出 ziplist 里的键
            field = hashTypeCurrentObject(hi, REDIS_HASH_KEY);
            field = tryObjectEncoding(field);

            // 取出 ziplist 里的值
            value = hashTypeCurrentObject(hi, REDIS_HASH_VALUE);
            value = tryObjectEncoding(value);

            // 将键值对添加到字典
            ret = dictAdd(dict, field, value);
            if (ret != DICT_OK) {
                redisLogHexDump(REDIS_WARNING,"ziplist with dup elements dump",
                    o->ptr,ziplistBlobLen(o->ptr));
                redisAssert(ret == DICT_OK);
            }
        }

        // 释放 ziplist 的迭代器
        hashTypeReleaseIterator(hi);

        // 释放对象原来的 ziplist
        zfree(o->ptr);

        // 更新哈希的编码和值对象
        o->encoding = REDIS_ENCODING_HT;
        o->ptr = dict;

    } else {
        redisPanic("Unknown hash encoding");
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0xf0, %eax
andl (%rdi), %eax
cmpl $0x50, %eax
jne 0x42bab
cmpl $0x5, %esi
je 0x42b9f
cmpl $0x2, %esi
jne 0x42bc0
movq %rdi, %rbx
callq 0x4275d
movq %rax, %r15
leaq 0x86eb1(%rip), %rdi     # 0xc9990
xorl %esi, %esi
callq 0x2217b
movq %rax, %r14
movq %r15, %rdi
callq 0x427e9
cmpl $-0x1, %eax
je 0x42b7e
movq %r15, %rdi
movl $0x1, %esi
callq 0x4299d
movq %rax, %rdi
callq 0x30c49
movq %rax, %r12
movq %r15, %rdi
movl $0x2, %esi
callq 0x4299d
movq %rax, %rdi
callq 0x30c49
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2249c
testl %eax, %eax
je 0x42ae9
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x2cc64
leaq 0x56b07(%rip), %rsi     # 0x99653
movl $0x3, %edi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x4dded
leaq 0x56b0f(%rip), %rdi     # 0x99672
leaq 0x56a58(%rip), %rsi     # 0x995c2
movl $0x298, %edx            # imm = 0x298
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
movq %r15, %rdi
callq 0x427cd
movq 0x8(%rbx), %rdi
callq 0x29af7
movl $0xffffff0f, %eax       # imm = 0xFFFFFF0F
andl (%rbx), %eax
orl $0x20, %eax
movl %eax, (%rbx)
movq %r14, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x569ea(%rip), %rdi     # 0x9959c
leaq 0x56a09(%rip), %rsi     # 0x995c2
movl $0x274, %edx            # imm = 0x274
jmp 0x42b6f
leaq 0x55f48(%rip), %rdi     # 0x98b0f
leaq 0x569f4(%rip), %rsi     # 0x995c2
movl $0x2a7, %edx            # imm = 0x2A7
callq 0x4cae0
jmp 0x42b74
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hsetCommand
void hsetCommand(redisClient *c) {
    int update;
    robj *o;

    // 取出或新创建哈希对象
    if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return;

    // 如果需要的话，转换哈希对象的编码
    hashTypeTryConversion(o,c->argv,2,3);

    // 编码 field 和 value 对象以节约空间
    hashTypeTryObjectEncoding(o,&c->argv[2], &c->argv[3]);

    // 设置 field 和 value 到 hash
    update = hashTypeSet(o,c->argv[2],c->argv[3]);

    // 返回状态：显示 field-value 对是新添加还是更新
    addReply(c, update ? shared.czero : shared.cone);

    // 发送键修改信号
    signalModifiedKey(c->db,c->argv[1]);

    // 发送事件通知
    notifyKeyspaceEvent(REDIS_NOTIFY_HASH,"hset",c->argv[1],c->db->id);

    // 将服务器设为脏
    server.dirty++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
callq 0x42a45
testq %rax, %rax
je 0x42c92
movq %rax, %r14
movq 0x38(%rbx), %rsi
movq %rax, %rdi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x42120
movq 0x38(%rbx), %rdx
leaq 0x10(%rdx), %rsi
addq $0x18, %rdx
movq %r14, %rdi
callq 0x421d3
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
movq %r14, %rdi
callq 0x4248e
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leaq 0x87bba(%rip), %rax     # 0xca800
movq 0x20(%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x2d97c
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x319b8
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x51830(%rip), %rsi     # 0x944aa
movl $0x40, %edi
callq 0x60371
leaq 0x8731d(%rip), %rax     # 0xc9fa8
incq 0x560(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hsetnxCommand
void hsetnxCommand(redisClient *c) {
    robj *o;

    // 取出或新创建哈希对象
    if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return;

    // 如果需要的话，转换哈希对象的编码
    hashTypeTryConversion(o,c->argv,2,3);

    // 如果 field-value 对已经存在
    // 那么回复 0 
    if (hashTypeExists(o, c->argv[2])) {
        addReply(c, shared.czero);

    // 否则，设置 field-value 对
    } else {
        // 对 field 和 value 对象编码，以节省空间
        hashTypeTryObjectEncoding(o,&c->argv[2], &c->argv[3]);
        // 设置
        hashTypeSet(o,c->argv[2],c->argv[3]);

        // 回复 1 ，表示设置成功
        addReply(c, shared.cone);

        // 发送键修改信号
        signalModifiedKey(c->db,c->argv[1]);

        // 发送事件通知
        notifyKeyspaceEvent(REDIS_NOTIFY_HASH,"hset",c->argv[1],c->db->id);

        // 将数据库设为脏
        server.dirty++;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
callq 0x42a45
testq %rax, %rax
je 0x42d78
movq %rax, %r14
movq 0x38(%rbx), %rsi
movq %rax, %rdi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x42120
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x4240e
testl %eax, %eax
je 0x42cfe
leaq 0x87b15(%rip), %rax     # 0xca800
movq 0x20(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2d97c
movq 0x38(%rbx), %rdx
leaq 0x10(%rdx), %rsi
addq $0x18, %rdx
movq %r14, %rdi
callq 0x421d3
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
movq %r14, %rdi
callq 0x4248e
leaq 0x87ad3(%rip), %rax     # 0xca800
movq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x2d97c
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x319b8
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x5174a(%rip), %rsi     # 0x944aa
movl $0x40, %edi
callq 0x60371
leaq 0x87237(%rip), %rax     # 0xc9fa8
incq 0x560(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hmsetCommand
void hmsetCommand(redisClient *c) {
    int i;
    robj *o;

    // field-value 参数必须成对出现
    if ((c->argc % 2) == 1) {
        addReplyError(c,"wrong number of arguments for HMSET");
        return;
    }

    // 取出或新创建哈希对象
    if ((o = hashTypeLookupWriteOrCreate(c,c->argv[1])) == NULL) return;

    // 如果需要的话，转换哈希对象的编码
    hashTypeTryConversion(o,c->argv,2,c->argc-1);

    // 遍历并设置所有 field-value 对
    for (i = 2; i < c->argc; i += 2) {
        // 编码 field-value 对，以节约空间
        hashTypeTryObjectEncoding(o,&c->argv[i], &c->argv[i+1]);
        // 设置
        hashTypeSet(o,c->argv[i],c->argv[i+1]);
    }

    // 向客户端发送回复
    addReply(c, shared.ok);

    // 发送键修改信号
    signalModifiedKey(c->db,c->argv[1]);

    // 发送事件通知
    notifyKeyspaceEvent(REDIS_NOTIFY_HASH,"hset",c->argv[1],c->db->id);

    // 将数据库设为脏
    server.dirty++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x80000001, %eax       # imm = 0x80000001
andl 0x30(%rdi), %eax
cmpl $0x1, %eax
jne 0x42db0
leaq 0x568f5(%rip), %rsi     # 0x99693
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2dc63
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x42a45
testq %rax, %rax
je 0x42e7d
movq %rax, %r14
movq 0x38(%rbx), %rsi
movl 0x30(%rbx), %ecx
decl %ecx
movl $0x2, %ebp
movq %rax, %rdi
movl $0x2, %edx
callq 0x42120
cmpl $0x3, 0x30(%rbx)
jl 0x42e2b
movl $0x18, %r15d
movq 0x38(%rbx), %rdx
leaq (%rdx,%r15), %rsi
addq $-0x8, %rsi
addq %r15, %rdx
movq %r14, %rdi
callq 0x421d3
movq 0x38(%rbx), %rax
movq -0x8(%rax,%r15), %rsi
movq (%rax,%r15), %rdx
movq %r14, %rdi
callq 0x4248e
addq $0x10, %r15
addl $0x2, %ebp
cmpl %ebp, 0x30(%rbx)
jg 0x42df3
leaq 0x879ce(%rip), %rax     # 0xca800
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2d97c
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x319b8
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x51645(%rip), %rsi     # 0x944aa
movl $0x40, %edi
callq 0x60371
leaq 0x87132(%rip), %rax     # 0xc9fa8
incq 0x560(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hgetCommand
void hgetCommand(redisClient *c) {
    robj *o;

    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.nullbulk)) == NULL ||
        checkType(c,o,REDIS_HASH)) return;

    // 取出并返回域的值
    addHashFieldToReply(c, o, c->argv[2]);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x8766f(%rip), %rax     # 0xca800
movq 0x50(%rax), %rdx
callq 0x31745
testq %rax, %rax
je 0x431b6
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x30bbf
testl %eax, %eax
je 0x431be
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x431d5
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: addHashFieldToReply
static void addHashFieldToReply(redisClient *c, robj *o, robj *field) {
    int ret;

    // 对象不存在
    if (o == NULL) {
        addReply(c, shared.nullbulk);
        return;
    }

    // ziplist 编码
    if (o->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *vstr = NULL;
        unsigned int vlen = UINT_MAX;
        long long vll = LLONG_MAX;

        // 取出值
        ret = hashTypeGetFromZiplist(o, field, &vstr, &vlen, &vll);
        if (ret < 0) {
            addReply(c, shared.nullbulk);
        } else {
            if (vstr) {
                addReplyBulkCBuffer(c, vstr, vlen);
            } else {
                addReplyBulkLongLong(c, vll);
            }
        }

    // 字典
    } else if (o->encoding == REDIS_ENCODING_HT) {
        robj *value;

        // 取出值
        ret = hashTypeGetFromHashTable(o, field, &value);
        if (ret < 0) {
            addReply(c, shared.nullbulk);
        } else {
            addReplyBulk(c, value);
        }

    } else {
        redisPanic("Unknown hash encoding");
    }
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
je 0x4324b
movl (%rsi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x43263
cmpl $0x5, %eax
jne 0x432b1
leaq 0x8(%rsp), %rax
movq $0x0, (%rax)
leaq 0x14(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rdi # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x18(%rsp), %r8
movq %rdi, (%r8)
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x42211
testl %eax, %eax
js 0x43289
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x4329e
movl 0x14(%rsp), %edx
movq %rbx, %rdi
callq 0x2e237
jmp 0x432ab
leaq 0x875ae(%rip), %rax     # 0xca800
movq 0x50(%rax), %rsi
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
jmp 0x2d97c
leaq 0x8(%rsp), %rax
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x42305
testl %eax, %eax
js 0x43289
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2e204
jmp 0x432ab
leaq 0x87570(%rip), %rax     # 0xca800
movq 0x50(%rax), %rsi
movq %rbx, %rdi
callq 0x2d97c
jmp 0x432ab
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2e277
addq $0x20, %rsp
popq %rbx
retq
leaq 0x55857(%rip), %rdi     # 0x98b0f
leaq 0x56303(%rip), %rsi     # 0x995c2
movl $0x3c1, %edx            # imm = 0x3C1
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hdelCommand
void hdelCommand(redisClient *c) {
    robj *o;
    int j, deleted = 0, keyremoved = 0;

    // 取出对象
    if ((o = lookupKeyWriteOrReply(c,c->argv[1],shared.czero)) == NULL ||
        checkType(c,o,REDIS_HASH)) return;

    // 删除指定域值对
    for (j = 2; j < c->argc; j++) {
        if (hashTypeDelete(o,c->argv[j])) {

            // 成功删除一个域值对时进行计数
            deleted++;

            // 如果哈希已经为空，那么删除这个对象
            if (hashTypeLength(o) == 0) {
                dbDelete(c->db,c->argv[1]);
                keyremoved = 1;
                break;
            }
        }
    }

    // 只要有至少一个域值对被修改了，那么执行以下代码
    if (deleted) {
        // 发送键修改信号
        signalModifiedKey(c->db,c->argv[1]);

        // 发送事件通知
        notifyKeyspaceEvent(REDIS_NOTIFY_HASH,"hdel",c->argv[1],c->db->id);

        // 发送事件通知
        if (keyremoved)
            notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,"del",c->argv[1],
                                c->db->id);

        // 将数据库设为脏
        server.dirty += deleted;
    }

    // 将成功删除的域值对数量作为结果返回给客户端
    addReplyLongLong(c,deleted);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x8748e(%rip), %rax     # 0xca800
movq 0x20(%rax), %rdx
callq 0x317a6
testq %rax, %rax
je 0x43397
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x30bbf
testl %eax, %eax
je 0x433a0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
cmpl $0x3, 0x30(%rbx)
jl 0x4346c
movl $0x2, %r12d
movq 0x38(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r15, %rdi
callq 0x4266c
testl %eax, %eax
je 0x433d7
incl %r14d
movq %r15, %rdi
callq 0x4261c
testq %rax, %rax
je 0x433e7
incq %r12
movslq 0x30(%rbx), %rax
cmpq %rax, %r12
jl 0x433b3
xorl %ebp, %ebp
jmp 0x433fb
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x31a36
movb $0x1, %bpl
testl %r14d, %r14d
je 0x43469
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x319b8
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x510b5(%rip), %rsi     # 0x944dc
movl $0x40, %edi
callq 0x60371
testb %bpl, %bpl
je 0x43456
movq 0x8(%rbx), %rax
movq 0x38(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x51091(%rip), %rsi     # 0x944dd
movl $0x4, %edi
callq 0x60371
movslq %r14d, %r14
leaq 0x86b48(%rip), %rax     # 0xc9fa8
addq %r14, 0x560(%rax)
jmp 0x4346c
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2e133
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hlenCommand
void hlenCommand(redisClient *c) {
    robj *o;

    // 取出哈希对象
    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
        checkType(c,o,REDIS_HASH)) return;

    // 回复
    addReplyLongLong(c,hashTypeLength(o));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x8736b(%rip), %rax     # 0xca800
movq 0x20(%rax), %rdx
callq 0x31745
testq %rax, %rax
je 0x434ba
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x30bbf
testl %eax, %eax
je 0x434c2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x4261c
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2e133
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: genericHgetallCommand
void genericHgetallCommand(redisClient *c, int flags) {
    robj *o;
    hashTypeIterator *hi;
    int multiplier = 0;
    int length, count = 0;

    // 取出哈希对象
    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptymultibulk)) == NULL
        || checkType(c,o,REDIS_HASH)) return;

    // 计算要取出的元素数量
    if (flags & REDIS_HASH_KEY) multiplier++;
    if (flags & REDIS_HASH_VALUE) multiplier++;

    length = hashTypeLength(o) * multiplier;

    addReplyMultiBulkLen(c, length);

    // 迭代节点，并取出元素
    hi = hashTypeInitIterator(o);
    while (hashTypeNext(hi) != REDIS_ERR) {
        // 取出键
        if (flags & REDIS_HASH_KEY) {
            addHashIteratorCursorToReply(c, hi, REDIS_HASH_KEY);
            count++;
        }
        // 取出值
        if (flags & REDIS_HASH_VALUE) {
            addHashIteratorCursorToReply(c, hi, REDIS_HASH_VALUE);
            count++;
        }
    }

    // 释放迭代器
    hashTypeReleaseIterator(hi);
    redisAssert(count == length);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x87305(%rip), %rax     # 0xca800
movq 0x68(%rax), %rdx
callq 0x31745
testq %rax, %rax
je 0x435b3
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x30bbf
testl %eax, %eax
jne 0x435b3
movl %ebx, %ebp
andl $0x1, %ebp
andl $0x2, %ebx
movl %ebx, %r13d
shrl %r13d
addl %ebp, %r13d
movq %r12, %rdi
callq 0x4261c
movq %rax, %r15
imull %r13d, %r15d
movslq %r15d, %rsi
movq %r14, %rdi
callq 0x2e168
movq %r12, %rdi
callq 0x4275d
movq %rax, %r12
movq %rax, %rdi
callq 0x427e9
xorl %r13d, %r13d
cmpl $-0x1, %eax
je 0x435a6
testl %ebp, %ebp
je 0x43585
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x435e4
incl %r13d
testl %ebx, %ebx
je 0x4359c
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x435e4
incl %r13d
movq %r12, %rdi
callq 0x427e9
jmp 0x43569
movq %r12, %rdi
callq 0x427cd
cmpl %r15d, %r13d
jne 0x435c2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x56130(%rip), %rdi     # 0x996f9
leaq 0x55ff2(%rip), %rsi     # 0x995c2
movl $0x45e, %edx            # imm = 0x45E
callq 0x4ca32
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: addHashIteratorCursorToReply
static void addHashIteratorCursorToReply(redisClient *c, hashTypeIterator *hi, int what) {

    // 处理 ZIPLIST
    if (hi->encoding == REDIS_ENCODING_ZIPLIST) {
        unsigned char *vstr = NULL;
        unsigned int vlen = UINT_MAX;
        long long vll = LLONG_MAX;

        hashTypeCurrentFromZiplist(hi, what, &vstr, &vlen, &vll);
        if (vstr) {
            addReplyBulkCBuffer(c, vstr, vlen);
        } else {
            addReplyBulkLongLong(c, vll);
        }

    // 处理 HT
    } else if (hi->encoding == REDIS_ENCODING_HT) {
        robj *value;

        hashTypeCurrentFromHashTable(hi, what, &value);
        addReplyBulk(c, value);

    } else {
        redisPanic("Unknown hash encoding");
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl $0x2, %eax
je 0x4364b
cmpl $0x5, %eax
jne 0x4367f
leaq 0x10(%rsp), %r14
movq $0x0, (%r14)
leaq 0x4(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
movq %rsi, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x428d7
movq (%r14), %rsi
testq %rsi, %rsi
je 0x4366a
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x2e237
jmp 0x43677
leaq 0x10(%rsp), %r14
movq %rsi, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x4295e
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x2e204
jmp 0x43677
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2e277
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x55489(%rip), %rdi     # 0x98b0f
leaq 0x55f35(%rip), %rsi     # 0x995c2
movl $0x437, %edx            # imm = 0x437
callq 0x4cae0
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hexistsCommand
void hexistsCommand(redisClient *c) {
    robj *o;

    // 取出哈希对象
    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
        checkType(c,o,REDIS_HASH)) return;

    // 检查给定域是否存在
    addReply(c, hashTypeExists(o,c->argv[2]) ? shared.cone : shared.czero);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0x8712a(%rip), %r15     # 0xca800
movq 0x20(%r15), %rdx
callq 0x31745
testq %rax, %rax
je 0x436fb
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x30bbf
testl %eax, %eax
je 0x43701
popq %rbx
popq %r14
popq %r15
retq
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x4240e
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movq 0x20(%r15,%rcx,8), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2d97c
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hscanCommand
void hscanCommand(redisClient *c) {
    robj *o;
    unsigned long cursor;

    if (parseScanCursorOrReply(c,c->argv[2],&cursor) == REDIS_ERR) return;
    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptyscan)) == NULL ||
        checkType(c,o,REDIS_HASH)) return;
    scanGenericCommand(c,o,cursor);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x10(%rax), %rsi
movq %rsp, %rdx
callq 0x32100
cmpl $-0x1, %eax
je 0x4378f
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x870ab(%rip), %rax     # 0xca800
movq 0x148(%rax), %rdx
movq %rbx, %rdi
callq 0x31745
testq %rax, %rax
je 0x4378f
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x4, %edx
callq 0x30bbf
testl %eax, %eax
jne 0x4378f
movq (%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3217d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/config.c
// Function: loadServerConfig
void loadServerConfig(char *filename, char *options) {
    sds config = sdsempty();
    char buf[REDIS_CONFIGLINE_MAX+1];

    /* Load the file content */
    // 载入文件内容
    if (filename) {
        FILE *fp;

        if (filename[0] == '-' && filename[1] == '\0') {
            fp = stdin;
        } else {
            if ((fp = fopen(filename,"r")) == NULL) {
                redisLog(REDIS_WARNING,
                    "Fatal error, can't open config file '%s'", filename);
                exit(1);
            }
        }
        while(fgets(buf,REDIS_CONFIGLINE_MAX+1,fp) != NULL)
            config = sdscat(config,buf);
        if (fp != stdin) fclose(fp);
    }

    /* Append the additional options */
    // 追加 options 字符串到内容的末尾
    if (options) {
        config = sdscat(config,"\n");
        config = sdscat(config,options);
    }

    // 根据字符串内容，设置服务器配置
    loadServerConfigFromString(config);

    sdsfree(config);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %rbx
movq %rdi, %r12
callq 0x2845e
movq %rax, %r14
testq %r12, %r12
je 0x44f03
cmpb $0x2d, (%r12)
jne 0x44e99
cmpb $0x0, 0x1(%r12)
je 0x44f44
leaq 0x5d27a(%rip), %rsi     # 0xa211a
movq %r12, %rdi
callq 0x1fa60
movq %rax, %r15
testq %rax, %rax
je 0x44f53
movq %rsp, %rdi
movl $0x401, %esi            # imm = 0x401
movq %r15, %rdx
callq 0x1f430
testq %rax, %rax
je 0x44eef
movq %rsp, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x286db
movq %rax, %r14
movq %r12, %rdi
movl $0x401, %esi            # imm = 0x401
movq %r15, %rdx
callq 0x1f430
testq %rax, %rax
jne 0x44ecc
movq 0x8107a(%rip), %rax     # 0xc5f70
cmpq (%rax), %r15
je 0x44f03
movq %r15, %rdi
callq 0x1f9a0
testq %rbx, %rbx
je 0x44f25
leaq 0x51882(%rip), %rsi     # 0x96791
movq %r14, %rdi
callq 0x286db
movq %rax, %rdi
movq %rbx, %rsi
callq 0x286db
movq %rax, %r14
movq %r14, %rdi
callq 0x4384d
movq %r14, %rdi
callq 0x2850d
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x81025(%rip), %rax     # 0xc5f70
movq (%rax), %r15
jmp 0x44eb4
leaq 0x5521b(%rip), %rsi     # 0x9a175
movl $0x3, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x23223
movl $0x1, %edi
callq 0x1f2b0
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/config.c
// Function: rewriteConfigStringOption
void rewriteConfigStringOption(struct rewriteConfigState *state, char *option, char *value, char *defvalue) {
    int force = 1;
    sds line;

    /* String options set to NULL need to be not present at all in the
     * configuration file to be set to NULL again at the next reboot. */
    if (value == NULL) {
        rewriteConfigMarkAsProcessed(state,option);
        return;
    }

    /* Compare the strings as sds strings to have a binary safe comparison. */
    if (defvalue && strcmp(value,defvalue) == 0) force = 0;

    line = sdsnew(option);
    line = sdscatlen(line, " ", 1);
    line = sdscatrepr(line, value, strlen(value));

    rewriteConfigRewriteLine(state,option,line,force);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x47ceb
movq %rdx, %r15
testq %rcx, %rcx
je 0x47cfe
movq %r15, %rdi
movq %rcx, %rsi
callq 0x1f880
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
jmp 0x47d03
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4781e
movl $0x1, %ebp
movq %rbx, %rdi
callq 0x28486
leaq 0x526fd(%rip), %rsi     # 0x9a40f
movl $0x1, %edx
movq %rax, %rdi
callq 0x28689
movq %rax, %r12
movq %r15, %rdi
callq 0x1f4f0
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x29259
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl %ebp, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x47a6a
// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/config.c
// Function: rewriteConfigEnumOption
void rewriteConfigEnumOption(struct rewriteConfigState *state, char *option, int value, ...) {
    va_list ap;
    char *enum_name, *matching_name = NULL;
    int enum_val, def_val, force;
    sds line;
    
    va_start(ap, value);
    while(1) {
        enum_name = va_arg(ap,char*);
        enum_val = va_arg(ap,int);
        if (enum_name == NULL) {
            def_val = enum_val;
            break;
        }
        if (value == enum_val) matching_name = enum_name;
    }
    va_end(ap);
    
    force = value != def_val;
    line = sdscatprintf(sdsempty(),"%s %s",option,matching_name);
    rewriteConfigRewriteLine(state,option,line,force);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x47e4a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rsp)
movl $0x18, %ecx
xorl %r15d, %r15d
cmpl $0x29, %ecx
jae 0x47e98
movl %ecx, %edi
leal 0x8(%rcx), %r8d
movl %r8d, (%rsp)
movq (%rsi,%rdi), %rdi
cmpl $0x20, %ecx
ja 0x47ea9
movl %r8d, %r8d
addq %rsi, %r8
addl $0x10, %ecx
movl %ecx, (%rsp)
jmp 0x47eb8
leaq 0x8(%rax), %r8
movq %r8, 0x8(%rsp)
movq (%rax), %rdi
movq %r8, %rax
jmp 0x47eac
movl %r8d, %ecx
movq %rax, %r8
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl (%r8), %r8d
testq %rdi, %rdi
je 0x47ec9
cmpl %edx, %r8d
cmoveq %rdi, %r15
jmp 0x47e72
xorl %ebp, %ebp
cmpl %edx, %r8d
setne %bpl
callq 0x2845e
leaq 0x57d8a(%rip), %rsi     # 0x9fc68
movq %rax, %rdi
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x28a5e
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x47a6a
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq