LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x5, 0x8(%rax)
jne 0x55c47
jmp 0x55c69
leaq 0x8da63(%rip), %rdi     # 0xe36b1
leaq 0x8da14(%rip), %rsi     # 0xe3669
movl $0x209, %edx            # imm = 0x209
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x55cbc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x33490
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x55c98
jmp 0x55cba
leaq 0x8d9e0(%rip), %rdi     # 0xe367f
leaq 0x8d9c3(%rip), %rsi     # 0xe3669
movl $0x20e, %edx            # imm = 0x20E
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
jmp 0x55d04
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x33490
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x55ce0
jmp 0x55d02
leaq 0x8d998(%rip), %rdi     # 0xe367f
leaq 0x8d97b(%rip), %rsi     # 0xe3669
movl $0x213, %edx            # imm = 0x213
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
jmp 0x55d04
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/t_hash.c
// Function: hashTypeCurrentFromHashTable
void hashTypeCurrentFromHashTable(hashTypeIterator *hi, int what, robj **dst) {
    redisAssert(hi->encoding == REDIS_ENCODING_HT);

    // 取出键
    if (what & REDIS_HASH_KEY) {
        *dst = dictGetKey(hi->de);

    // 取出值
    } else {
        *dst = dictGetVal(hi->de);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x55d2f
jmp 0x55d51
leaq 0x8d9a2(%rip), %rdi     # 0xe36d8
leaq 0x8d92c(%rip), %rsi     # 0xe3669
movl $0x21d, %edx            # imm = 0x21D
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x55d70
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x55d83
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x5, 0x8(%rax)
jne 0x55e08
movq $0x0, -0x20(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x30(%rbp), %r8
callq 0x55c20
cmpq $0x0, -0x20(%rbp)
je 0x55df9
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x3a2e0
movq %rax, -0x18(%rbp)
jmp 0x55e06
movq -0x30(%rbp), %rdi
callq 0x3a330
movq %rax, -0x18(%rbp)
jmp 0x55e51
movq -0x8(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x55e2d
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x18(%rbp), %rdx
callq 0x55d10
movq -0x18(%rbp), %rdi
callq 0x3a3f0
jmp 0x55e4f
leaq 0x8cd47(%rip), %rdi     # 0xe2b7b
leaq 0x8d82e(%rip), %rsi     # 0xe3669
movl $0x250, %edx            # imm = 0x250
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
jmp 0x55e51
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3c090
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x55eac
callq 0x3a760
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3c160
jmp 0x55eda
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
je 0x55ed8
movq -0x10(%rbp), %rdi
leaq 0xbe28b(%rip), %rax     # 0x114150
movq 0x70(%rax), %rsi
callq 0x35a70
movq $0x0, -0x8(%rbp)
jmp 0x55ee2
jmp 0x55eda
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x55e60
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x560d0
jmp 0x561cc
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x54f70
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
addq $0x10, %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
addq $0x18, %rdx
callq 0x550c0
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x18(%rax), %rdx
callq 0x55510
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x5614f
leaq 0xbe00b(%rip), %rax     # 0x114150
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x5615e
leaq 0xbdffa(%rip), %rax     # 0x114150
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x35a70
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3c3d0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x40, %edi
leaq 0x8832b(%rip), %rsi     # 0xde4d2
callq 0x814a0
leaq 0xbd745(%rip), %rax     # 0x1138f8
movq 0x560(%rax), %rcx
addq $0x1, %rcx
leaq 0xbd733(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x55e60
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x56210
jmp 0x56315
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x54f70
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x55440
cmpl $0x0, %eax
je 0x5625e
movq -0x8(%rbp), %rdi
leaq 0xbdf00(%rip), %rax     # 0x114150
movq 0x20(%rax), %rsi
callq 0x35a70
jmp 0x56315
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
addq $0x10, %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
addq $0x18, %rdx
callq 0x550c0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x18(%rax), %rdx
callq 0x55510
movq -0x8(%rbp), %rdi
leaq 0xbdea5(%rip), %rax     # 0x114150
movq 0x28(%rax), %rsi
callq 0x35a70
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3c3d0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x40, %edi
leaq 0x881e2(%rip), %rsi     # 0xde4d2
callq 0x814a0
leaq 0xbd5fc(%rip), %rax     # 0x1138f8
movq 0x560(%rax), %rcx
addq $0x1, %rcx
leaq 0xbd5ea(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x56355
movq -0x8(%rbp), %rdi
leaq 0x8d3ef(%rip), %rsi     # 0xe373a
callq 0x35d40
jmp 0x5648d
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x55e60
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x56379
jmp 0x5648d
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
subl $0x1, %ecx
movl $0x2, %edx
callq 0x54f70
movl $0x2, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x56418
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movslq -0xc(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdx
movl -0xc(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x3, %rax
addq %rax, %rdx
callq 0x550c0
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
callq 0x55510
movl -0xc(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
jmp 0x563a0
movq -0x8(%rbp), %rdi
leaq 0xbdd2d(%rip), %rax     # 0x114150
movq 0x8(%rax), %rsi
callq 0x35a70
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3c3d0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x40, %edi
leaq 0x8806a(%rip), %rsi     # 0xde4d2
callq 0x814a0
leaq 0xbd484(%rip), %rax     # 0x1138f8
movq 0x560(%rax), %rcx
addq $0x1, %rcx
leaq 0xbd472(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xbd8dd(%rip), %rax     # 0x114150
movq 0x50(%rax), %rdx
callq 0x3c0c0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x5689d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3abb0
cmpl $0x0, %eax
je 0x5689f
jmp 0x568b8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rdx
callq 0x568c0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x568f4
movq -0x8(%rbp), %rdi
leaq 0xbd86a(%rip), %rax     # 0x114150
movq 0x50(%rax), %rsi
callq 0x35a70
jmp 0x569fe
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
jne 0x5698a
movq $0x0, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x38(%rbp), %r8
callq 0x55130
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x5695e
movq -0x8(%rbp), %rdi
leaq 0xbd7fd(%rip), %rax     # 0x114150
movq 0x50(%rax), %rsi
callq 0x35a70
jmp 0x56988
cmpq $0x0, -0x28(%rbp)
je 0x56979
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x2c(%rbp), %eax
movl %eax, %edx
callq 0x36670
jmp 0x56986
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x366c0
jmp 0x56988
jmp 0x569fe
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x569da
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x552b0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x569cb
movq -0x8(%rbp), %rdi
leaq 0xbd790(%rip), %rax     # 0x114150
movq 0x50(%rax), %rsi
callq 0x35a70
jmp 0x569d8
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x36620
jmp 0x569fc
leaq 0x8c19a(%rip), %rdi     # 0xe2b7b
leaq 0x8cc81(%rip), %rsi     # 0xe3669
movl $0x3c1, %edx            # imm = 0x3C1
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
jmp 0x569fe
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xbd65f(%rip), %rax     # 0x114150
movq 0x20(%rax), %rdx
callq 0x3c110
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x56b1b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3abb0
cmpl $0x0, %eax
je 0x56b20
jmp 0x56c40
movl $0x2, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x56b9a
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x55840
cmpl $0x0, %eax
je 0x56b8d
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x557a0
cmpq $0x0, %rax
jne 0x56b8b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3c4f0
movl $0x1, -0x1c(%rbp)
jmp 0x56b9a
jmp 0x56b8d
jmp 0x56b8f
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x56b27
cmpl $0x0, -0x18(%rbp)
je 0x56c33
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3c3d0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x40, %edi
leaq 0x87924(%rip), %rsi     # 0xde504
callq 0x814a0
cmpl $0x0, -0x1c(%rbp)
je 0x56c13
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0x878f7(%rip), %rsi     # 0xde505
callq 0x814a0
movslq -0x18(%rbp), %rcx
leaq 0xbccda(%rip), %rax     # 0x1138f8
addq 0x560(%rax), %rcx
leaq 0xbcccc(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
movq -0x8(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x36480
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xbd4dd(%rip), %rax     # 0x114150
movq 0x20(%rax), %rdx
callq 0x3c0c0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x56c9d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3abb0
cmpl $0x0, %eax
je 0x56c9f
jmp 0x56cbc
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x557a0
movq -0x18(%rbp), %rdi
movq %rax, %rsi
callq 0x36480
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xbd44c(%rip), %rax     # 0x114150
movq 0x68(%rax), %rdx
callq 0x3c0c0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x56d2e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x4, %edx
callq 0x3abb0
cmpl $0x0, %eax
je 0x56d33
jmp 0x56e1a
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x56d47
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x56d5b
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x557a0
movslq -0x24(%rbp), %rcx
imulq %rcx, %rax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x364f0
movq -0x18(%rbp), %rdi
callq 0x559a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x55a90
cmpl $-0x1, %eax
je 0x56de5
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x56dbd
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x56e20
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x56de3
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x2, %edx
callq 0x56e20
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x56d89
movq -0x20(%rbp), %rdi
callq 0x55a50
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0x56df8
jmp 0x56e1a
leaq 0x8c9a1(%rip), %rdi     # 0xe37a0
leaq 0x8c863(%rip), %rsi     # 0xe3669
movl $0x45e, %edx            # imm = 0x45E
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x5, 0x8(%rax)
jne 0x56e9c
movq $0x0, -0x20(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x30(%rbp), %r8
callq 0x55c20
cmpq $0x0, -0x20(%rbp)
je 0x56e8d
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %eax
movl %eax, %edx
callq 0x36670
jmp 0x56e9a
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x366c0
jmp 0x56ee9
movq -0x10(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x56ec5
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x38(%rbp), %rdx
callq 0x55d10
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x36620
jmp 0x56ee7
leaq 0x8bcaf(%rip), %rdi     # 0xe2b7b
leaq 0x8c796(%rip), %rsi     # 0xe3669
movl $0x437, %edx            # imm = 0x437
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
jmp 0x56ee9
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xbd1dd(%rip), %rax     # 0x114150
movq 0x20(%rax), %rdx
callq 0x3c0c0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x56f9d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3abb0
cmpl $0x0, %eax
je 0x56f9f
jmp 0x56fee
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x55440
cmpl $0x0, %eax
je 0x56fd2
leaq 0xbd188(%rip), %rax     # 0x114150
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x56fe1
leaq 0xbd177(%rip), %rax     # 0x114150
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x35a70
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rsi
leaq -0x18(%rbp), %rdx
callq 0x3cf50
cmpl $-0x1, %eax
jne 0x5702c
jmp 0x57083
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0xbd10d(%rip), %rax     # 0x114150
movq 0x148(%rax), %rdx
callq 0x3c0c0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x57070
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3abb0
cmpl $0x0, %eax
je 0x57072
jmp 0x57083
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3d000
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2c0c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5917a
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x590e3
movq -0x8(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x590e3
movq 0xb5ef1(%rip), %rax     # 0x10efc8
movq (%rax), %rax
movq %rax, -0x428(%rbp)
jmp 0x59123
movq -0x8(%rbp), %rdi
leaq 0x87be5(%rip), %rsi     # 0xe0cd3
callq 0x1fa70
movq %rax, -0x428(%rbp)
cmpq $0x0, %rax
jne 0x59121
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0x8b134(%rip), %rsi     # 0xe4244
movb $0x0, %al
callq 0x24fb0
movl $0x1, %edi
callq 0x1f2c0
jmp 0x59123
jmp 0x59125
leaq -0x420(%rbp), %rdi
movq -0x428(%rbp), %rdx
movl $0x401, %esi            # imm = 0x401
callq 0x1f430
cmpq $0x0, %rax
je 0x59159
movq -0x18(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x2c5b0
movq %rax, -0x18(%rbp)
jmp 0x59125
movq -0x428(%rbp), %rax
movq 0xb5e61(%rip), %rcx     # 0x10efc8
cmpq (%rcx), %rax
je 0x59178
movq -0x428(%rbp), %rdi
callq 0x1f9b0
jmp 0x5917a
cmpq $0x0, -0x10(%rbp)
je 0x591a6
movq -0x18(%rbp), %rdi
leaq 0x8762d(%rip), %rsi     # 0xe07b9
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x57230
movq -0x18(%rbp), %rdi
callq 0x2c160
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5ceb8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5c870
jmp 0x5cf3f
cmpq $0x0, -0x20(%rbp)
je 0x5ced8
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1f890
cmpl $0x0, %eax
jne 0x5ced8
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c0e0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x875ee(%rip), %rsi     # 0xe44de
movl $0x1, %edx
callq 0x2c500
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1f4d0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x2d820
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x5cb20
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
testb %al, %al
je 0x5d071
movaps %xmm0, -0xe0(%rbp)
movaps %xmm1, -0xd0(%rbp)
movaps %xmm2, -0xc0(%rbp)
movaps %xmm3, -0xb0(%rbp)
movaps %xmm4, -0xa0(%rbp)
movaps %xmm5, -0x90(%rbp)
movaps %xmm6, -0x80(%rbp)
movaps %xmm7, -0x70(%rbp)
movq %r9, -0xe8(%rbp)
movq %r8, -0xf0(%rbp)
movq %rcx, -0xf8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x30(%rbp), %rax
leaq -0x110(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x18, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x120(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x114(%rbp)
cmpl $0x28, %eax
ja 0x5d0f8
movq -0x120(%rbp), %rcx
movl -0x114(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x128(%rbp)
jmp 0x5d115
movq -0x120(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x138(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x12c(%rbp)
cmpl $0x28, %eax
ja 0x5d15e
movq -0x138(%rbp), %rcx
movl -0x12c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x140(%rbp)
jmp 0x5d17b
movq -0x138(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x5d196
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0x5d1ab
movl -0x14(%rbp), %eax
cmpl -0x44(%rbp), %eax
jne 0x5d1a6
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x5d0bd
movl -0x14(%rbp), %eax
movl -0x48(%rbp), %ecx
subl %ecx, %eax
setne %al
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
callq 0x2c0c0
movq %rax, %rdi
movq -0x10(%rbp), %rdx
movq -0x40(%rbp), %rcx
leaq 0x8ca59(%rip), %rsi     # 0xe9c2c
xorl %eax, %eax
callq 0x2cad0
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl -0x4c(%rbp), %ecx
callq 0x5cb20
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/config.c
// Function: rewriteConfigSyslogfacilityOption
void rewriteConfigSyslogfacilityOption(struct rewriteConfigState *state) {
    int value = server.syslog_facility, j;
    int force = value != LOG_LOCAL0;
    char *name = NULL, *option = "syslog-facility";
    sds line;

    for (j = 0; validSyslogFacilities[j].name; j++) {
        if (validSyslogFacilities[j].value == value) {
            name = (char*) validSyslogFacilities[j].name;
            break;
        }
    }
    line = sdscatprintf(sdsempty(),"%s %s",option,name);
    rewriteConfigRewriteLine(state,option,line,force);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xb66e5(%rip), %rax     # 0x1138f8
movl 0x5e8(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x80, -0xc(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
leaq 0x86780(%rip), %rax     # 0xe39bd
movq %rax, -0x28(%rbp)
movl $0x0, -0x10(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0xb58dd(%rip), %rax     # 0x112b30
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x5d2a2
movslq -0x10(%rbp), %rcx
leaq 0xb58c5(%rip), %rax     # 0x112b30
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x5d295
movslq -0x10(%rbp), %rcx
leaq 0xb58ab(%rip), %rax     # 0x112b30
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x5d2a2
jmp 0x5d297
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5d248
callq 0x2c0c0
movq %rax, %rdi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x8c973(%rip), %rsi     # 0xe9c2c
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x14(%rbp), %ecx
callq 0x5cb20
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: aofRewriteBufferSize
unsigned long aofRewriteBufferSize(void) {

    // 取出链表中最后的缓存块
    listNode *ln = listLast(server.aof_rewrite_buf_blocks);
    aofrwblock *block = ln ? ln->value : NULL;

    // 没有缓存被使用
    if (block == NULL) return 0;

    // 总缓存大小 = （缓存块数量-1） * AOF_RW_BUF_BLOCK_SIZE + 最后一个缓存块的大小
    unsigned long size =
        (listLength(server.aof_rewrite_buf_blocks)-1) * AOF_RW_BUF_BLOCK_SIZE;
    size += block->used;

    return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xb512d(%rip), %rax     # 0x1138f8
movq 0x508(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x5e7ef
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x5e7f7
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x5e7f7
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5e810
movq $0x0, -0x8(%rbp)
jmp 0x5e848
leaq 0xb50e1(%rip), %rax     # 0x1138f8
movq 0x508(%rax), %rax
movq 0x28(%rax), %rax
subq $0x1, %rax
imulq $0xa00000, %rax, %rax   # imm = 0xA00000
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: aofRewriteBufferWrite
ssize_t aofRewriteBufferWrite(int fd) {
    listNode *ln;
    listIter li;
    ssize_t count = 0;

    // 遍历所有缓存块
    listRewind(server.aof_rewrite_buf_blocks,&li);
    while((ln = listNext(&li))) {
        aofrwblock *block = listNodeValue(ln);
        ssize_t nwritten;

        if (block->used) {

            // 写入缓存块内容到 fd
            nwritten = write(fd,block->buf,block->used);
            if (nwritten != block->used) {
                if (nwritten == 0) errno = EIO;
                return -1;
            }

            // 积累写入字节
            count += nwritten;
        }
    }

    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0xb4ede(%rip), %rax     # 0x1138f8
movq 0x508(%rax), %rdi
leaq -0x28(%rbp), %rsi
callq 0x202b0
leaq -0x28(%rbp), %rdi
callq 0x20310
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x5eaa5
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5eaa3
movl -0xc(%rbp), %edi
movq -0x38(%rbp), %rsi
addq $0x10, %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
callq 0x1fb50
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
je 0x5ea97
cmpq $0x0, -0x40(%rbp)
jne 0x5ea8d
callq 0x1f820
movl $0x5, (%rax)
movq $-0x1, -0x8(%rbp)
jmp 0x5eaad
movq -0x40(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x5ea2a
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: stopAppendOnly
void stopAppendOnly(void) {

    // AOF 必须正在启用，才能调用这个函数
    redisAssert(server.aof_state != REDIS_AOF_OFF);

    // 将 AOF 缓存的内容写入并冲洗到 AOF 文件中
    // 参数 1 表示强制模式
    flushAppendOnlyFile(1);

    // 冲洗 AOF 文件
    aof_fsync(server.aof_fd);

    // 关闭 AOF 文件
    close(server.aof_fd);

    // 清空 AOF 状态
    server.aof_fd = -1;
    server.aof_selected_db = -1;
    server.aof_state = REDIS_AOF_OFF;

    /* rewrite operation in progress? kill it, wait child exit 
    *
    * 如果 BGREWRITEAOF 正在执行，那么杀死它
    * 并等待子进程退出
    */
    if (server.aof_child_pid != -1) {
        int statloc;

        redisLog(REDIS_NOTICE,"Killing running AOF rewrite child: %ld",
            (long) server.aof_child_pid);

        // 杀死子进程
        if (kill(server.aof_child_pid,SIGUSR1) != -1)
            wait3(&statloc,0,NULL);

        /* reset the buffer accumulating changes while the child saves 
         * 清理未完成的 AOF 重写留下来的缓存和临时文件
         */
        aofRewriteBufferReset();
        aofRemoveTempFile(server.aof_child_pid);
        server.aof_child_pid = -1;
        server.aof_rewrite_time_start = -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xb4df9(%rip), %rax     # 0x1138f8
cmpl $0x0, 0x4d0(%rax)
je 0x5eb0a
jmp 0x5eb2c
leaq 0x85ba2(%rip), %rdi     # 0xe46b3
leaq 0x85bbd(%rip), %rsi     # 0xe46d5
movl $0xed, %edx
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
movl $0x1, %edi
callq 0x5ec30
leaq 0xb4dbb(%rip), %rax     # 0x1138f8
movl 0x518(%rax), %edi
callq 0x1f540
leaq 0xb4da9(%rip), %rax     # 0x1138f8
movl 0x518(%rax), %edi
callq 0x1f170
leaq 0xb4d97(%rip), %rax     # 0x1138f8
movl $0xffffffff, 0x518(%rax) # imm = 0xFFFFFFFF
leaq 0xb4d86(%rip), %rax     # 0x1138f8
movl $0xffffffff, 0x51c(%rax) # imm = 0xFFFFFFFF
leaq 0xb4d75(%rip), %rax     # 0x1138f8
movl $0x0, 0x4d0(%rax)
leaq 0xb4d64(%rip), %rax     # 0x1138f8
cmpl $-0x1, 0x504(%rax)
je 0x5ec27
leaq 0xb4d50(%rip), %rax     # 0x1138f8
movslq 0x504(%rax), %rdx
movl $0x2, %edi
leaq 0x85b20(%rip), %rsi     # 0xe46db
movb $0x0, %al
callq 0x24fb0
leaq 0xb4d2f(%rip), %rax     # 0x1138f8
movl 0x504(%rax), %edi
movl $0xa, %esi
callq 0x1f620
cmpl $-0x1, %eax
je 0x5ebed
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x1f810
callq 0x5e760
leaq 0xb4cff(%rip), %rax     # 0x1138f8
movl 0x504(%rax), %edi
callq 0x5f130
leaq 0xb4ced(%rip), %rax     # 0x1138f8
movl $0xffffffff, 0x504(%rax) # imm = 0xFFFFFFFF
leaq 0xb4cdc(%rip), %rax     # 0x1138f8
movq $-0x1, 0x538(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: startAppendOnly
int startAppendOnly(void) {

    // 将开始时间设为 AOF 最后一次 fsync 时间 
    server.aof_last_fsync = server.unixtime;

    // 打开 AOF 文件
    server.aof_fd = open(server.aof_filename,O_WRONLY|O_APPEND|O_CREAT,0644);

    redisAssert(server.aof_state == REDIS_AOF_OFF);

    // 文件打开失败
    if (server.aof_fd == -1) {
        redisLog(REDIS_WARNING,"Redis needs to enable the AOF but can't open the append only file: %s",strerror(errno));
        return REDIS_ERR;
    }

    if (rewriteAppendOnlyFileBackground() == REDIS_ERR) {
        // AOF 后台重写失败，关闭 AOF 文件
        close(server.aof_fd);
        redisLog(REDIS_WARNING,"Redis needs to enable the AOF but can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.");
        return REDIS_ERR;
    }

    /* We correctly switched on AOF, now wait for the rerwite to be complete
     * in order to append data on disk. 
     *
     * 等待重写执行完毕
     */
    server.aof_state = REDIS_AOF_WAIT_REWRITE;

    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xb4779(%rip), %rax     # 0x1138f8
movq 0x798(%rax), %rcx
leaq 0xb476b(%rip), %rax     # 0x1138f8
movq %rcx, 0x528(%rax)
leaq 0xb475d(%rip), %rax     # 0x1138f8
movq 0x4d8(%rax), %rdi
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x1f640
movl %eax, %ecx
leaq 0xb473c(%rip), %rax     # 0x1138f8
movl %ecx, 0x518(%rax)
leaq 0xb472f(%rip), %rax     # 0x1138f8
cmpl $0x0, 0x4d0(%rax)
jne 0x5f1d4
jmp 0x5f1f6
leaq 0x85527(%rip), %rdi     # 0xe4702
leaq 0x854f3(%rip), %rsi     # 0xe46d5
movl $0x125, %edx            # imm = 0x125
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
leaq 0xb46fb(%rip), %rax     # 0x1138f8
cmpl $-0x1, 0x518(%rax)
jne 0x5f231
callq 0x1f820
movl (%rax), %edi
callq 0x1f630
movq %rax, %rdx
movl $0x3, %edi
leaq 0x85503(%rip), %rsi     # 0xe4724
movb $0x0, %al
callq 0x24fb0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5f281
callq 0x5f290
cmpl $-0x1, %eax
jne 0x5f269
leaq 0xb46b6(%rip), %rax     # 0x1138f8
movl 0x518(%rax), %edi
callq 0x1f170
movl $0x3, %edi
leaq 0x85511(%rip), %rsi     # 0xe476a
movb $0x0, %al
callq 0x24fb0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5f281
leaq 0xb4688(%rip), %rax     # 0x1138f8
movl $0x2, 0x4d0(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)