LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: dupStringObject
robj *dupStringObject(robj *o) {
    robj *d;

    redisAssert(o->type == REDIS_STRING);

    switch(o->encoding) {

    case REDIS_ENCODING_RAW:
        return createRawStringObject(o->ptr,sdslen(o->ptr));

    case REDIS_ENCODING_EMBSTR:
        return createEmbeddedStringObject(o->ptr,sdslen(o->ptr));

    case REDIS_ENCODING_INT:
        d = createObject(REDIS_STRING, NULL);
        d->encoding = REDIS_ENCODING_INT;
        d->ptr = o->ptr;
        return d;

    default:
        redisPanic("Wrong encoding.");
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3a50c
jmp 0x3a52e
leaq 0xa693d(%rip), %rdi     # 0xe0e50
leaq 0xa6f2d(%rip), %rsi     # 0xe1447
movl $0xc0, %edx
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, -0x1c(%rbp)
je 0x3a558
jmp 0x3a541
movl -0x1c(%rbp), %eax
subl $0x1, %eax
je 0x3a5b1
jmp 0x3a54b
movl -0x1c(%rbp), %eax
subl $0x8, %eax
je 0x3a586
jmp 0x3a5eb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3a090
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x3a190
movq %rax, -0x8(%rbp)
jmp 0x3a60d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3a090
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x3a1c0
movq %rax, -0x8(%rbp)
jmp 0x3a60d
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x3a0d0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
orl $0x10, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3a60d
leaq 0xa6e5e(%rip), %rdi     # 0xe1450
leaq 0xa6e4e(%rip), %rsi     # 0xe1447
movl $0xd1, %edx
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createListObject
robj *createListObject(void) {

    list *l = listCreate();

    robj *o = createObject(REDIS_LIST,l);

    listSetFreeMethod(l,decrRefCountVoid);

    o->encoding = REDIS_ENCODING_LINKEDLIST;

    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x1fdb0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movl $0x1, %edi
callq 0x3a0d0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
leaq 0x22(%rip), %rcx        # 0x3a670
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
orl $0x40, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createZiplistObject
robj *createZiplistObject(void) {

    unsigned char *zl = ziplistNew();

    robj *o = createObject(REDIS_LIST,zl);

    o->encoding = REDIS_ENCODING_ZIPLIST;

    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x32a00
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movl $0x1, %edi
callq 0x3a0d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
orl $0x50, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createSetObject
robj *createSetObject(void) {

    dict *d = dictCreate(&setDictType,NULL);

    robj *o = createObject(REDIS_SET,d);

    o->encoding = REDIS_ENCODING_HT;

    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xd81a1(%rip), %rdi     # 0x112880
xorl %eax, %eax
movl %eax, %esi
callq 0x231a0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movl $0x2, %edi
callq 0x3a0d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
orl $0x20, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createIntsetObject
robj *createIntsetObject(void) {

    intset *is = intsetNew();

    robj *o = createObject(REDIS_SET,is);

    o->encoding = REDIS_ENCODING_INTSET;

    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x67330
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movl $0x2, %edi
callq 0x3a0d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
orl $0x60, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createZsetObject
robj *createZsetObject(void) {

    zset *zs = zmalloc(sizeof(*zs));

    robj *o;

    zs->dict = dictCreate(&zsetDictType,NULL);
    zs->zsl = zslCreate();

    o = createObject(REDIS_ZSET,zs);

    o->encoding = REDIS_ENCODING_SKIPLIST;

    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x10, %edi
callq 0x2e130
movq %rax, -0x8(%rbp)
leaq 0xd80f3(%rip), %rdi     # 0x1128b0
xorl %eax, %eax
movl %eax, %esi
callq 0x231a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
callq 0x4d060
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rsi
movl $0x3, %edi
callq 0x3a0d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
orl $0x70, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: freeListObject
void freeListObject(robj *o) {

    switch (o->encoding) {

    case REDIS_ENCODING_LINKEDLIST:
        listRelease((list*) o->ptr);
        break;

    case REDIS_ENCODING_ZIPLIST:
        zfree(o->ptr);
        break;

    default:
        redisPanic("Unknown list encoding type");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, -0xc(%rbp)
subl $0x4, %eax
je 0x3a8ac
jmp 0x3a8a2
movl -0xc(%rbp), %eax
subl $0x5, %eax
je 0x3a8bb
jmp 0x3a8ca
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1fe30
jmp 0x3a8ec
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2e3a0
jmp 0x3a8ec
leaq 0xa6b91(%rip), %rdi     # 0xe1462
leaq 0xa6b6f(%rip), %rsi     # 0xe1447
movl $0x158, %edx            # imm = 0x158
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: freeSetObject
void freeSetObject(robj *o) {

    switch (o->encoding) {

    case REDIS_ENCODING_HT:
        dictRelease((dict*) o->ptr);
        break;

    case REDIS_ENCODING_INTSET:
        zfree(o->ptr);
        break;

    default:
        redisPanic("Unknown set encoding type");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, -0xc(%rbp)
subl $0x2, %eax
je 0x3a92c
jmp 0x3a922
movl -0xc(%rbp), %eax
subl $0x6, %eax
je 0x3a93b
jmp 0x3a94a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x24000
jmp 0x3a96c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2e3a0
jmp 0x3a96c
leaq 0xa6b2e(%rip), %rdi     # 0xe147f
leaq 0xa6aef(%rip), %rsi     # 0xe1447
movl $0x16c, %edx            # imm = 0x16C
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: freeZsetObject
void freeZsetObject(robj *o) {

    zset *zs;

    switch (o->encoding) {

    case REDIS_ENCODING_SKIPLIST:
        zs = o->ptr;
        dictRelease(zs->dict);
        zslFree(zs->zsl);
        zfree(zs);
        break;

    case REDIS_ENCODING_ZIPLIST:
        zfree(o->ptr);
        break;

    default:
        redisPanic("Unknown sorted set encoding");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, -0x14(%rbp)
subl $0x5, %eax
je 0x3a9dc
jmp 0x3a9a2
movl -0x14(%rbp), %eax
subl $0x7, %eax
jne 0x3a9eb
jmp 0x3a9ac
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x24000
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4d150
movq -0x10(%rbp), %rdi
callq 0x2e3a0
jmp 0x3aa0d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2e3a0
jmp 0x3aa0d
leaq 0xa6aa9(%rip), %rdi     # 0xe149b
leaq 0xa6a4e(%rip), %rsi     # 0xe1447
movl $0x185, %edx            # imm = 0x185
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: freeHashObject
void freeHashObject(robj *o) {

    switch (o->encoding) {

    case REDIS_ENCODING_HT:
        dictRelease((dict*) o->ptr);
        break;

    case REDIS_ENCODING_ZIPLIST:
        zfree(o->ptr);
        break;

    default:
        redisPanic("Unknown hash encoding type");
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, -0xc(%rbp)
subl $0x2, %eax
je 0x3aa4c
jmp 0x3aa42
movl -0xc(%rbp), %eax
subl $0x5, %eax
je 0x3aa5b
jmp 0x3aa6a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x24000
jmp 0x3aa8c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2e3a0
jmp 0x3aa8c
leaq 0xa6a48(%rip), %rdi     # 0xe14b9
leaq 0xa69cf(%rip), %rsi     # 0xe1447
movl $0x199, %edx            # imm = 0x199
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: decrRefCount
void decrRefCount(robj *o) {

    if (o->refcount <= 0) redisPanic("decrRefCount against refcount <= 0");

    // 释放对象
    if (o->refcount == 1) {
        switch(o->type) {
        case REDIS_STRING: freeStringObject(o); break;
        case REDIS_LIST: freeListObject(o); break;
        case REDIS_SET: freeSetObject(o); break;
        case REDIS_ZSET: freeZsetObject(o); break;
        case REDIS_HASH: freeHashObject(o); break;
        default: redisPanic("Unknown object type"); break;
        }
        zfree(o);

    // 减少计数
    } else {
        o->refcount--;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jg 0x3aad8
leaq 0xa6a19(%rip), %rdi     # 0xe14d6
leaq 0xa6983(%rip), %rsi     # 0xe1447
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
movq -0x8(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0x3ab72
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x4, %eax
ja 0x3ab45
movq -0x10(%rbp), %rax
leaq 0xa68f7(%rip), %rcx     # 0xe13fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
callq 0x3a850
jmp 0x3ab67
movq -0x8(%rbp), %rdi
callq 0x3a880
jmp 0x3ab67
movq -0x8(%rbp), %rdi
callq 0x3a900
jmp 0x3ab67
movq -0x8(%rbp), %rdi
callq 0x3a980
jmp 0x3ab67
movq -0x8(%rbp), %rdi
callq 0x3aa20
jmp 0x3ab67
leaq 0xa69af(%rip), %rdi     # 0xe14fb
leaq 0xa68f4(%rip), %rsi     # 0xe1447
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
movq -0x8(%rbp), %rdi
callq 0x2e3a0
jmp 0x3ab7f
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: checkType
int checkType(redisClient *c, robj *o, int type) {

    if (o->type != type) {
        addReply(c,shared.wrongtypeerr);
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl -0x1c(%rbp), %eax
je 0x3abee
movq -0x10(%rbp), %rdi
leaq 0xd9574(%rip), %rax     # 0x114150
movq 0x70(%rax), %rsi
callq 0x35a70
movl $0x1, -0x4(%rbp)
jmp 0x3abf5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: isObjectRepresentableAsLongLong
int isObjectRepresentableAsLongLong(robj *o, long long *llval) {

    redisAssertWithInfo(NULL,o,o->type == REDIS_STRING);

    // INT 编码的 long 值总是能保存为 long long
    if (o->encoding == REDIS_ENCODING_INT) {
        if (llval) *llval = (long) o->ptr;
        return REDIS_OK;

    // 如果是字符串的话，那么尝试将它转换为 long long
    } else {
        return string2ll(o->ptr,sdslen(o->ptr),llval) ? REDIS_OK : REDIS_ERR;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3ac20
jmp 0x3ac4b
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xa6221(%rip), %rdx     # 0xe0e50
leaq 0xa6811(%rip), %rcx     # 0xe1447
movl $0x1fd, %r8d            # imm = 0x1FD
callq 0x648b0
movl $0x1, %edi
callq 0x1f3b0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x3ac7b
cmpq $0x0, -0x18(%rbp)
je 0x3ac72
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x3acb6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3a090
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x39780
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getDecodedObject
robj *getDecodedObject(robj *o) {
    robj *dec;

    if (sdsEncodedObject(o)) {
        incrRefCount(o);
        return o;
    }

    // 解码对象，将对象的值从整数转换为字符串
    if (o->type == REDIS_STRING && o->encoding == REDIS_ENCODING_INT) {
        char buf[32];

        ll2string(buf,32,(long)o->ptr);
        dec = createStringObject(buf,strlen(buf));
        return dec;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x3af1e
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x3af34
movq -0x10(%rbp), %rdi
callq 0x3a3f0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3afb6
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3af94
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x3af94
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x20, %esi
callq 0x39660
leaq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1f4d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x3a2e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3afb6
leaq 0xa6576(%rip), %rdi     # 0xe1511
leaq 0xa64a5(%rip), %rsi     # 0xe1447
movl $0x27a, %edx            # imm = 0x27A
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: equalStringObjects
int equalStringObjects(robj *a, robj *b) {

    // 对象的编码为 INT ，直接对比值
    // 这里避免了将整数值转换为字符串，所以效率更高
    if (a->encoding == REDIS_ENCODING_INT &&
        b->encoding == REDIS_ENCODING_INT){
        /* If both strings are integer encoded just check if the stored
         * long is the same. */
        return a->ptr == b->ptr;

    // 进行字符串对象
    } else {
        return compareStringObjects(a,b) == 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x3b28f
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x3b28f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x3b2aa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3b1e0
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: stringObjectLen
size_t stringObjectLen(robj *o) {

    redisAssertWithInfo(NULL,o,o->type == REDIS_STRING);

    if (sdsEncodedObject(o)) {
        return sdslen(o->ptr);

    // INT 编码，计算将这个值转换为字符串要多少字节
    // 相当于返回它的长度
    } else {
        char buf[32];
        return ll2string(buf,32,(long)o->ptr);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3b2dc
jmp 0x3b307
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xa5b65(%rip), %rdx     # 0xe0e50
leaq 0xa6155(%rip), %rcx     # 0xe1447
movl $0x2e5, %r8d            # imm = 0x2E5
callq 0x648b0
movl $0x1, %edi
callq 0x1f3b0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x3b329
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x3b33c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3a090
movq %rax, -0x8(%rbp)
jmp 0x3b358
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x20, %esi
callq 0x39660
cltq
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getDoubleFromObjectOrReply
int getDoubleFromObjectOrReply(redisClient *c, robj *o, double *target, const char *msg) {

    double value;

    if (getDoubleFromObject(o, &value) != REDIS_OK) {
        if (msg != NULL) {
            addReplyError(c,(char*)msg);
        } else {
            addReplyError(c,"value is not a valid float");
        }
        return REDIS_ERR;
    }

    *target = value;
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3b370
cmpl $0x0, %eax
je 0x3b579
cmpq $0x0, -0x28(%rbp)
je 0x3b560
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x35d40
jmp 0x3b570
movq -0x10(%rbp), %rdi
leaq 0xa8215(%rip), %rsi     # 0xe3780
callq 0x35d40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b58d
movsd -0x30(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getLongDoubleFromObject
int getLongDoubleFromObject(robj *o, long double *target) {
    long double value;
    char *eptr;

    if (o == NULL) {
        value = 0;
    } else {

        redisAssertWithInfo(NULL,o,o->type == REDIS_STRING);

        // RAW 编码，尝试从字符串中转换 long double
        if (sdsEncodedObject(o)) {
            errno = 0;
            value = strtold(o->ptr, &eptr);
            if (isspace(((char*)o->ptr)[0]) || eptr[0] != '\0' ||
                errno == ERANGE || isnan(value))
                return REDIS_ERR;

        // INT 编码，直接保存
        } else if (o->encoding == REDIS_ENCODING_INT) {
            value = (long)o->ptr;

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

    *target = value;
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3b5c1
fldz
fstpt -0x30(%rbp)
jmp 0x3b6db
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3b5d1
jmp 0x3b5fc
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xa5870(%rip), %rdx     # 0xe0e50
leaq 0xa5e60(%rip), %rcx     # 0xe1447
movl $0x344, %r8d            # imm = 0x344
callq 0x648b0
movl $0x1, %edi
callq 0x1f3b0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x3b61e
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x3b690
callq 0x1f820
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1f0f0
fstpt -0x30(%rbp)
callq 0x1f530
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x3b685
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3b685
callq 0x1f820
cmpl $0x22, (%rax)
je 0x3b685
fldt -0x30(%rbp)
fucompi %st(0), %st
setp %al
testb $0x1, %al
jne 0x3b685
jmp 0x3b68e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b6eb
jmp 0x3b6d9
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x3b6b5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
fildll -0x40(%rbp)
fstpt -0x30(%rbp)
jmp 0x3b6d7
leaq 0xa5ea0(%rip), %rdi     # 0xe155c
leaq 0xa5d84(%rip), %rsi     # 0xe1447
movl $0x353, %edx            # imm = 0x353
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
jmp 0x3b6d9
jmp 0x3b6db
fldt -0x30(%rbp)
movq -0x18(%rbp), %rax
fstpt (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getLongDoubleFromObjectOrReply
int getLongDoubleFromObjectOrReply(redisClient *c, robj *o, long double *target, const char *msg) {

    long double value;

    if (getLongDoubleFromObject(o, &value) != REDIS_OK) {
        if (msg != NULL) {
            addReplyError(c,(char*)msg);
        } else {
            addReplyError(c,"value is not a valid float");
        }
        return REDIS_ERR;
    }

    *target = value;
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3b5a0
cmpl $0x0, %eax
je 0x3b759
cmpq $0x0, -0x28(%rbp)
je 0x3b740
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x35d40
jmp 0x3b750
movq -0x10(%rbp), %rdi
leaq 0xa8035(%rip), %rsi     # 0xe3780
callq 0x35d40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b769
fldt -0x40(%rbp)
movq -0x20(%rbp), %rax
fstpt (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getLongLongFromObject
int getLongLongFromObject(robj *o, long long *target) {
    long long value;
    char *eptr;

    if (o == NULL) {
        // o 为 NULL 时，将值设为 0 。
        value = 0;
    } else {

        // 确保对象为 REDIS_STRING 类型
        redisAssertWithInfo(NULL,o,o->type == REDIS_STRING);
        if (sdsEncodedObject(o)) {
            errno = 0;
            // T = O(N)
            value = strtoll(o->ptr, &eptr, 10);
            if (isspace(((char*)o->ptr)[0]) || eptr[0] != '\0' ||
                errno == ERANGE)
                return REDIS_ERR;
        } else if (o->encoding == REDIS_ENCODING_INT) {
            // 对于 REDIS_ENCODING_INT 编码的整数值
            // 直接将它的值保存到 value 中
            value = (long)o->ptr;
        } else {
            redisPanic("Unknown string encoding");
        }
    }

    // 保存值到指针
    if (target) *target = value;

    // 返回结果标识符
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3b7a4
movq $0x0, -0x20(%rbp)
jmp 0x3b8b0
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3b7b4
jmp 0x3b7df
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xa568d(%rip), %rdx     # 0xe0e50
leaq 0xa5c7d(%rip), %rcx     # 0xe1447
movl $0x38a, %r8d            # imm = 0x38A
callq 0x648b0
movl $0x1, %edi
callq 0x1f3b0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x3b801
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x3b86b
callq 0x1f820
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x28(%rbp), %rsi
movl $0xa, %edx
callq 0x1fa80
movq %rax, -0x20(%rbp)
callq 0x1f530
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x3b860
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3b860
callq 0x1f820
cmpl $0x22, (%rax)
jne 0x3b869
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b8c9
jmp 0x3b8ae
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x3b88a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x3b8ac
leaq 0xa5ccb(%rip), %rdi     # 0xe155c
leaq 0xa5baf(%rip), %rsi     # 0xe1447
movl $0x397, %edx            # imm = 0x397
callq 0x63d40
movl $0x1, %edi
callq 0x1f3b0
jmp 0x3b8ae
jmp 0x3b8b0
cmpq $0x0, -0x18(%rbp)
je 0x3b8c2
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getLongLongFromObjectOrReply
int getLongLongFromObjectOrReply(redisClient *c, robj *o, long long *target, const char *msg) {

    long long value;

    // T = O(N)
    if (getLongLongFromObject(o, &value) != REDIS_OK) {
        if (msg != NULL) {
            addReplyError(c,(char*)msg);
        } else {
            addReplyError(c,"value is not an integer or out of range");
        }
        return REDIS_ERR;
    }

    *target = value;

    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3b780
cmpl $0x0, %eax
je 0x3b939
cmpq $0x0, -0x28(%rbp)
je 0x3b920
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x35d40
jmp 0x3b930
movq -0x10(%rbp), %rdi
leaq 0xa5c4b(%rip), %rsi     # 0xe1576
callq 0x35d40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b94b
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getLongFromObjectOrReply
int getLongFromObjectOrReply(redisClient *c, robj *o, long *target, const char *msg) {
    long long value;

    // 先尝试以 long long 类型取出值
    if (getLongLongFromObjectOrReply(c, o, &value, msg) != REDIS_OK) return REDIS_ERR;

    // 然后检查值是否在 long 类型的范围之内
    if (value < LONG_MIN || value > LONG_MAX) {
        if (msg != NULL) {
            addReplyError(c,(char*)msg);
        } else {
            addReplyError(c,"value is out of range");
        }
        return REDIS_ERR;
    }

    *target = value;
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
leaq -0x30(%rbp), %rdx
callq 0x3b8e0
cmpl $0x0, %eax
je 0x3b99b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b9fc
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x30(%rbp)
jl 0x3b9bb
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x30(%rbp)
jle 0x3b9ea
cmpq $0x0, -0x28(%rbp)
je 0x3b9d1
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x35d40
jmp 0x3b9e1
movq -0x10(%rbp), %rdi
leaq 0xa5bc2(%rip), %rsi     # 0xe159e
callq 0x35d40
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b9fc
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: strEncoding
char *strEncoding(int encoding) {

    switch(encoding) {

    case REDIS_ENCODING_RAW: return "raw";
    case REDIS_ENCODING_INT: return "int";
    case REDIS_ENCODING_HT: return "hashtable";
    case REDIS_ENCODING_LINKEDLIST: return "linkedlist";
    case REDIS_ENCODING_ZIPLIST: return "ziplist";
    case REDIS_ENCODING_INTSET: return "intset";
    case REDIS_ENCODING_SKIPLIST: return "skiplist";
    case REDIS_ENCODING_EMBSTR: return "embstr";
    default: return "unknown";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x8, %rax
ja 0x3baa0
movq -0x18(%rbp), %rax
leaq 0xa59e1(%rip), %rcx     # 0xe1410
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa5b75(%rip), %rax     # 0xe15b4
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xb245f(%rip), %rax     # 0xedeab
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b5f(%rip), %rax     # 0xe15b8
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b5c(%rip), %rax     # 0xe15c2
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b5a(%rip), %rax     # 0xe15cd
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b55(%rip), %rax     # 0xe15d5
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b4f(%rip), %rax     # 0xe15dc
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b4b(%rip), %rax     # 0xe15e5
movq %rax, -0x8(%rbp)
jmp 0x3baab
leaq 0xa5b45(%rip), %rax     # 0xe15ec
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/object.c
// Function: estimateObjectIdleTime
unsigned long long estimateObjectIdleTime(robj *o) {
    unsigned long long lruclock = LRU_CLOCK();
    if (lruclock >= o->lru) {
        return (lruclock - o->lru) * REDIS_LRU_CLOCK_RESOLUTION;
    } else {
        return (lruclock + (REDIS_LRU_CLOCK_MAX - o->lru)) *
                    REDIS_LRU_CLOCK_RESOLUTION;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x3e8, %eax            # imm = 0x3E8
leaq 0xd7e20(%rip), %rcx     # 0x1138f8
cltd
idivl 0x8(%rcx)
cmpl $0x3e8, %eax            # imm = 0x3E8
jg 0x3baf7
leaq 0xd7e0e(%rip), %rax     # 0x1138f8
movl 0x30(%rax), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, -0x1c(%rbp)
jmp 0x3baff
callq 0x25cb0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %eax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
shrl $0x8, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jb 0x3bb3b
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
shrl $0x8, %ecx
movl %ecx, %ecx
subq %rcx, %rax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, -0x8(%rbp)
jmp 0x3bb60
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl (%rcx), %edx
shrl $0x8, %edx
movl $0xffffff, %ecx         # imm = 0xFFFFFF
subl %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: lookupKey
robj *lookupKey(redisDb *db, robj *key) {

    // 查找键空间
    dictEntry *de = dictFind(db->dict,key->ptr);

    // 节点存在
    if (de) {
        

        // 取出值
        robj *val = dictGetVal(de);

        /* Update the access time for the ageing algorithm.
         * Don't do it if we have a saving child, as this will trigger
         * a copy on write madness. */
        // 更新时间信息（只在不存在子进程时执行，防止破坏 copy-on-write 机制）
        if (server.rdb_child_pid == -1 && server.aof_child_pid == -1)
            val->lru = LRU_CLOCK();

        // 返回值
        return val;
    } else {

        // 节点不存在

        return NULL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x23aa0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3beb8
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
leaq 0xd7ab2(%rip), %rax     # 0x1138f8
cmpl $-0x1, 0x570(%rax)
jne 0x3beae
leaq 0xd7aa2(%rip), %rax     # 0x1138f8
cmpl $-0x1, 0x504(%rax)
jne 0x3beae
movl $0x3e8, %eax            # imm = 0x3E8
leaq 0xd7a8d(%rip), %rcx     # 0x1138f8
cltd
idivl 0x8(%rcx)
cmpl $0x3e8, %eax            # imm = 0x3E8
jg 0x3be8a
leaq 0xd7a7b(%rip), %rax     # 0x1138f8
movl 0x30(%rax), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, -0x2c(%rbp)
jmp 0x3be92
callq 0x25cb0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff, %edx         # imm = 0xFFFFFF
shll $0x8, %edx
andl $0xff, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3bec0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: lookupKeyRead
robj *lookupKeyRead(redisDb *db, robj *key) {
    robj *val;

    // 检查 key 释放已经过期
    expireIfNeeded(db,key);

    // 从数据库中取出键的值
    val = lookupKey(db,key);

    // 更新命中/不命中信息
    if (val == NULL)
        server.stat_keyspace_misses++;
    else
        server.stat_keyspace_hits++;

    // 返回值
    return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3bf60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3be00
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3bf27
leaq 0xd79ec(%rip), %rax     # 0x1138f8
movq 0x370(%rax), %rcx
addq $0x1, %rcx
leaq 0xd79da(%rip), %rax     # 0x1138f8
movq %rcx, 0x370(%rax)
jmp 0x3bf47
leaq 0xd79ca(%rip), %rax     # 0x1138f8
movq 0x368(%rax), %rcx
addq $0x1, %rcx
leaq 0xd79b8(%rip), %rax     # 0x1138f8
movq %rcx, 0x368(%rax)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: lookupKeyReadOrReply
robj *lookupKeyReadOrReply(redisClient *c, robj *key, robj *reply) {

    // 查找
    robj *o = lookupKeyRead(c->db, key);

    // 决定是否发送信息
    if (!o) addReply(c,reply);

    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x3bed0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3c0fd
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x35a70
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: dbAdd
void dbAdd(redisDb *db, robj *key, robj *val) {

    // 复制键名
    sds copy = sdsdup(key->ptr);

    // 尝试添加键值对
    int retval = dictAdd(db->dict, copy, val);

    // 如果键已经存在，那么停止
    redisAssertWithInfo(NULL,key,retval == REDIS_OK);

    // 如果开启了集群模式，那么将键保存到槽里面
    if (server.cluster_enabled) slotToKeyAdd(key);
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2c130
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x236d0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x3c1a4
jmp 0x3c1cf
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xa549d(%rip), %rdx     # 0xe1650
leaq 0xa694b(%rip), %rcx     # 0xe2b05
movl $0xaf, %r8d
callq 0x648b0
movl $0x1, %edi
callq 0x1f3b0
leaq 0xd7722(%rip), %rax     # 0x1138f8
cmpl $0x0, 0x7bc(%rax)
je 0x3c1e8
movq -0x10(%rbp), %rdi
callq 0x3c1f0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: slotToKeyAdd
void slotToKeyAdd(robj *key) {

    // 计算出键所属的槽
    unsigned int hashslot = keyHashSlot(key->ptr,sdslen(key->ptr));

    // 将槽 slot 作为分值，键作为成员，添加到 slots_to_keys 跳跃表里面
    zslInsert(server.cluster->slots_to_keys,hashslot,key);
    incrRefCount(key);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq %rdi, -0x18(%rbp)
callq 0x3bdc0
movq -0x18(%rbp), %rdi
movl %eax, %esi
callq 0x69ec0
movl %eax, -0xc(%rbp)
leaq 0xd76d6(%rip), %rax     # 0x1138f8
movq 0x7d0(%rax), %rax
movq 0x60028(%rax), %rdi
movl -0xc(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x8(%rbp), %rsi
callq 0x4d210
movq -0x8(%rbp), %rdi
callq 0x3a3f0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: dbOverwrite
void dbOverwrite(redisDb *db, robj *key, robj *val) {
    dictEntry *de = dictFind(db->dict,key->ptr);
    
    // 节点必须存在，否则中止
    redisAssertWithInfo(NULL,key,de != NULL);

    // 覆写旧值
    dictReplace(db->dict, key->ptr, val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x23aa0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3c285
jmp 0x3c2b0
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xa5580(%rip), %rdx     # 0xe1814
leaq 0xa686a(%rip), %rcx     # 0xe2b05
movl $0xc8, %r8d
callq 0x648b0
movl $0x1, %edi
callq 0x1f3b0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x239c0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: dbUnshareStringValue
robj *dbUnshareStringValue(redisDb *db, robj *key, robj *o) {
    redisAssert(o->type == REDIS_STRING);
    if (o->refcount != 1 || o->encoding != REDIS_ENCODING_RAW) {
        robj *decoded = getDecodedObject(o);
        o = createRawStringObject(decoded->ptr, sdslen(decoded->ptr));
        decrRefCount(decoded);
        dbOverwrite(db,key,o);
    }
    return o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x3c604
jmp 0x3c626
leaq 0xa4845(%rip), %rdi     # 0xe0e50
leaq 0xa64f3(%rip), %rsi     # 0xe2b05
movl $0x155, %edx            # imm = 0x155
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
movq -0x18(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0x3c641
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x3c691
movq -0x18(%rbp), %rdi
callq 0x3aef0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3bdc0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x3a190
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3aaa0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3c250
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/db.c
// Function: selectDb
int selectDb(redisClient *c, int id) {

    // 确保 id 在正确范围内
    if (id < 0 || id >= server.dbnum)
        return REDIS_ERR;

    // 切换数据库（更新指针）
    c->db = &server.db[id];

    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x3c7f3
movl -0x14(%rbp), %eax
leaq 0xd710d(%rip), %rcx     # 0x1138f8
cmpl 0x480(%rcx), %eax
jl 0x3c7fc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3c821
leaq 0xd70f5(%rip), %rax     # 0x1138f8
movq 0x10(%rax), %rcx
movslq -0x14(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: flushallCommand
void flushallCommand(redisClient *c) {

    // 发送通知
    signalFlushedDb(-1);

    // 清空所有数据库
    server.dirty += emptyDb(NULL);
    addReply(c,shared.ok);

    // 如果正在保存新的 RDB ，那么取消保存操作
    if (server.rdb_child_pid != -1) {
        kill(server.rdb_child_pid,SIGUSR1);
        rdbRemoveTempFile(server.rdb_child_pid);
    }

    // 更新 RDB 文件
    if (server.saveparamslen > 0) {
        /* Normally rdbSave() will reset dirty, but we don't want this here
         * as otherwise FLUSHALL will not be replicated nor put into the AOF. */
        // rdbSave() 会清空服务器的 dirty 属性
        // 但为了确保 FLUSHALL 命令会被正常传播，
        // 程序需要保存并在 rdbSave() 调用之后还原服务器的 dirty 属性
        int saved_dirty = server.dirty;

        rdbSave(server.rdb_filename);

        server.dirty = saved_dirty;
    }

    server.dirty++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3c830
xorl %eax, %eax
movl %eax, %edi
callq 0x3c6a0
movq %rax, %rcx
leaq 0xd6fcf(%rip), %rax     # 0x1138f8
addq 0x560(%rax), %rcx
leaq 0xd6fc1(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
movq -0x8(%rbp), %rdi
leaq 0xd7807(%rip), %rax     # 0x114150
movq 0x8(%rax), %rsi
callq 0x35a70
leaq 0xd6f9f(%rip), %rax     # 0x1138f8
cmpl $-0x1, 0x570(%rax)
je 0x3c98b
leaq 0xd6f8f(%rip), %rax     # 0x1138f8
movl 0x570(%rax), %edi
movl $0xa, %esi
callq 0x1f620
leaq 0xd6f78(%rip), %rax     # 0x1138f8
movl 0x570(%rax), %edi
callq 0x45090
leaq 0xd6f66(%rip), %rax     # 0x1138f8
cmpl $0x0, 0x580(%rax)
jle 0x3c9d1
leaq 0xd6f56(%rip), %rax     # 0x1138f8
movq 0x560(%rax), %rax
movl %eax, -0xc(%rbp)
leaq 0xd6f45(%rip), %rax     # 0x1138f8
movq 0x588(%rax), %rdi
callq 0x449a0
movslq -0xc(%rbp), %rcx
leaq 0xd6f2e(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
leaq 0xd6f20(%rip), %rax     # 0x1138f8
movq 0x560(%rax), %rcx
addq $0x1, %rcx
leaq 0xd6f0e(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: delCommand
void delCommand(redisClient *c) {
    int deleted = 0, j;

    // 遍历所有输入键
    for (j = 1; j < c->argc; j++) {

        // 先删除过期的键
        expireIfNeeded(c->db,c->argv[j]);

        // 尝试删除键
        if (dbDelete(c->db,c->argv[j])) {

            // 删除键成功，发送通知

            signalModifiedKey(c->db,c->argv[j]);
            notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,
                "del",c->argv[j],c->db->id);

            server.dirty++;

            // 成功删除才增加 deleted 计数器的值
            deleted++;
        }
    }

    // 返回被删除键的数量
    addReplyLongLong(c,deleted);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x3caeb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3bf60
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3c4f0
cmpl $0x0, %eax
je 0x3cadb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3c3d0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0xa1a58(%rip), %rsi     # 0xde505
callq 0x814a0
leaq 0xd6e3f(%rip), %rax     # 0x1138f8
movq 0x560(%rax), %rcx
addq $0x1, %rcx
leaq 0xd6e2d(%rip), %rax     # 0x1138f8
movq %rcx, 0x560(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3cadd
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3ca1a
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x36480
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: existsCommand
void existsCommand(redisClient *c) {

    // 检查键是否已经过期，如果已过期的话，那么将它删除
    // 这可以避免已过期的键被误认为存在
    expireIfNeeded(c->db,c->argv[1]);

    // 在数据库中查找
    if (dbExists(c->db,c->argv[1])) {
        addReply(c, shared.cone);
    } else {
        addReply(c, shared.czero);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3bf60
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x3c400
cmpl $0x0, %eax
je 0x3cb59
movq -0x8(%rbp), %rdi
leaq 0xd7602(%rip), %rax     # 0x114150
movq 0x28(%rax), %rsi
callq 0x35a70
jmp 0x3cb6d
movq -0x8(%rbp), %rdi
leaq 0xd75ec(%rip), %rax     # 0x114150
movq 0x20(%rax), %rsi
callq 0x35a70
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/db.c
// Function: selectCommand
void selectCommand(redisClient *c) {
    long id;

    // 不合法的数据库号码
    if (getLongFromObjectOrReply(c, c->argv[1], &id,
        "invalid DB index") != REDIS_OK)
        return;

    if (server.cluster_enabled && id != 0) {
        addReplyError(c,"SELECT is not allowed in cluster mode");
        return;
    }

    // 切换数据库
    if (selectDb(c,id) == REDIS_ERR) {
        addReplyError(c,"invalid DB index");
    } else {
        addReply(c,shared.ok);
    }
}

// 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 -0x10(%rbp), %rdx
leaq 0xa4abc(%rip), %rcx     # 0xe1663
callq 0x3b960
cmpl $0x0, %eax
je 0x3cbb3
jmp 0x3cc16
leaq 0xd6d3e(%rip), %rax     # 0x1138f8
cmpl $0x0, 0x7bc(%rax)
je 0x3cbdc
cmpq $0x0, -0x10(%rbp)
je 0x3cbdc
movq -0x8(%rbp), %rdi
leaq 0xa4a9f(%rip), %rsi     # 0xe1674
callq 0x35d40
jmp 0x3cc16
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl %eax, %esi
callq 0x3c7d0
cmpl $-0x1, %eax
jne 0x3cc02
movq -0x8(%rbp), %rdi
leaq 0xa4a68(%rip), %rsi     # 0xe1663
callq 0x35d40
jmp 0x3cc16
movq -0x8(%rbp), %rdi
leaq 0xd7543(%rip), %rax     # 0x114150
movq 0x8(%rax), %rsi
callq 0x35a70
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)