LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: createFakeClient
struct redisClient *createFakeClient(void) {
    struct redisClient *c = zmalloc(sizeof(*c));

    selectDb(c,0);

    c->fd = -1;
    c->name = NULL;
    c->querybuf = sdsempty();
    c->querybuf_peak = 0;
    c->argc = 0;
    c->argv = NULL;
    c->bufpos = 0;
    c->flags = 0;
    c->btype = REDIS_BLOCKED_NONE;
    /* We set the fake client as a slave waiting for the synchronization
     * so that Redis will not try to send replies to this client. 
     *
     * 将客户端设置为正在等待同步的附属节点，这样客户端就不会发送回复了。
     */
    c->replstate = REDIS_REPL_WAIT_BGSAVE_START;
    c->reply = listCreate();
    c->reply_bytes = 0;
    c->obuf_soft_limit_reached_time = 0;
    c->watched_keys = listCreate();
    c->peerid = NULL;
    listSetFreeMethod(c->reply,decrRefCountVoid);
    listSetDupMethod(c->reply,dupClientReplyValue);
    initClientMultiState(c);

    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x4178, %edi           # imm = 0x4178
callq 0x29709
movq %rax, %rbx
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
callq 0x3192d
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq %r14, 0x18(%rbx)
callq 0x281b2
movq %rax, 0x20(%rbx)
movq %r14, 0x28(%rbx)
movl %r14d, 0x30(%rbx)
movq %r14, 0x38(%rbx)
movl %r14d, 0x170(%rbx)
movl %r14d, 0x90(%rbx)
movl %r14d, 0x118(%rbx)
movl $0x6, 0x98(%rbx)
callq 0x2038c
movq %rax, 0x60(%rbx)
movq %r14, 0x68(%rbx)
movq %r14, 0x88(%rbx)
callq 0x2038c
movq %rax, 0x150(%rbx)
movq %r14, 0x168(%rbx)
movq 0x60(%rbx), %rax
leaq -0x19a82(%rip), %rcx    # 0x3058c
movq %rcx, 0x18(%rax)
leaq -0x1d2e5(%rip), %rcx    # 0x2cd34
movq %rcx, 0x10(%rax)
movq %rbx, %rdi
callq 0x4c1ec
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: aofUpdateCurrentSize
void aofUpdateCurrentSize(void) {
    struct redis_stat sb;

    // 读取文件状态
    if (redis_fstat(server.aof_fd,&sb) == -1) {
        redisLog(REDIS_WARNING,"Unable to obtain the AOF file length. stat: %s",
            strerror(errno));
    } else {
        // 设置到服务器
        server.aof_current_size = sb.st_size;
    }
}

// Assembly:
pushq %rbx
subq $0x90, %rsp
leaq 0x7fb37(%rip), %rbx     # 0xc9fa8
movl 0x518(%rbx), %edi
movq %rsp, %rsi
callq 0x1f690
cmpl $-0x1, %eax
je 0x4a499
movq 0x30(%rsp), %rax
movq %rax, 0x4f8(%rbx)
addq $0x90, %rsp
popq %rbx
retq
callq 0x1f810
movl (%rax), %edi
callq 0x1f630
leaq 0x5091d(%rip), %rsi     # 0x9adc9
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
jmp 0x23064
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: rioWriteBulkObject
int rioWriteBulkObject(rio *r, robj *obj) {
    /* Avoid using getDecodedObject to help copy-on-write (we are often
     * in a child process when this function is called). */
    if (obj->encoding == REDIS_ENCODING_INT) {
        return rioWriteBulkLongLong(r,(long)obj->ptr);
    } else if (sdsEncodedObject(obj)) {
        return rioWriteBulkString(r,obj->ptr,sdslen(obj->ptr));
    } else {
        redisPanic("Unknown string encoding");
    }
}

// Assembly:
pushq %rax
movl (%rsi), %eax
shrl $0x4, %eax
andl $0xf, %eax
je 0x4a4e3
cmpl $0x8, %eax
je 0x4a4e3
cmpl $0x1, %eax
jne 0x4a4f2
movq 0x8(%rsi), %rsi
callq 0x59069
jmp 0x4a4f0
movq 0x8(%rsi), %rsi
movslq -0x8(%rsi), %rdx
callq 0x58f52
popq %rcx
retq
leaq 0x4cf1b(%rip), %rdi     # 0x97414
leaq 0x50109(%rip), %rsi     # 0x9a609
movl $0x3fe, %edx            # imm = 0x3FE
callq 0x4d0e5
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: rewriteHashObject
int rewriteHashObject(rio *r, robj *key, robj *o) {
    hashTypeIterator *hi;
    long long count = 0, items = hashTypeLength(o);

    hi = hashTypeInitIterator(o);
    while (hashTypeNext(hi) != REDIS_ERR) {
        if (count == 0) {
            int cmd_items = (items > REDIS_AOF_REWRITE_ITEMS_PER_CMD) ?
                REDIS_AOF_REWRITE_ITEMS_PER_CMD : items;

            if (rioWriteBulkCount(r,'*',2+cmd_items*2) == 0) return 0;
            if (rioWriteBulkString(r,"HMSET",5) == 0) return 0;
            if (rioWriteBulkObject(r,key) == 0) return 0;
        }

        if (rioWriteHashIteratorCursor(r, hi, REDIS_HASH_KEY) == 0) return 0;
        if (rioWriteHashIteratorCursor(r, hi, REDIS_HASH_VALUE) == 0) return 0;
        if (++count == REDIS_AOF_REWRITE_ITEMS_PER_CMD) count = 0;
        items--;
    }

    hashTypeReleaseIterator(hi);

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x4274d
movq %rax, %r15
movq %r12, %rdi
callq 0x4288e
movq %rax, %r12
movq %rax, %rdi
callq 0x4291a
cmpl $-0x1, %eax
je 0x4ad17
xorl %r13d, %r13d
testq %r13, %r13
jne 0x4acc9
cmpq $0x40, %r15
movl $0x40, %eax
cmovlq %r15, %rax
leal 0x2(,%rax,2), %edx
movq %r14, %rdi
movl $0x2a, %esi
callq 0x58eae
xorl %ebp, %ebp
testq %rax, %rax
je 0x4ad24
movl $0x5, %edx
movq %r14, %rdi
leaq 0x4e9b9(%rip), %rsi     # 0x99669
callq 0x58f52
testq %rax, %rax
je 0x4ad24
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4a4c3
testl %eax, %eax
je 0x4ad24
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x4ad35
xorl %ebp, %ebp
testl %eax, %eax
je 0x4ad24
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x4ad35
testl %eax, %eax
je 0x4ad24
incq %r13
cmpq $0x40, %r13
movl $0x0, %eax
cmoveq %rax, %r13
decq %r15
movq %r12, %rdi
callq 0x4291a
cmpl $-0x1, %eax
jne 0x4ac70
movq %r12, %rdi
callq 0x428fe
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: rioWriteHashIteratorCursor
static int rioWriteHashIteratorCursor(rio *r, hashTypeIterator *hi, int what) {

    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) {
            return rioWriteBulkString(r, (char*)vstr, vlen);
        } else {
            return rioWriteBulkLongLong(r, vll);
        }

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

        hashTypeCurrentFromHashTable(hi, what, &value);
        return rioWriteBulkObject(r, value);
    }

    redisPanic("Unknown hash encoding");
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl $0x2, %eax
je 0x4ad9c
cmpl $0x5, %eax
jne 0x4add0
leaq 0x10(%rsp), %r14
movq $0x0, (%r14)
leaq 0x4(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
movq %rsi, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x42a25
movq (%r14), %rsi
testq %rsi, %rsi
je 0x4adbb
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x58f52
jmp 0x4adc8
leaq 0x10(%rsp), %r14
movq %rsi, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x42aac
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4a4c3
jmp 0x4adc8
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x59069
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x4dcdc(%rip), %rdi     # 0x98ab3
leaq 0x4f82b(%rip), %rsi     # 0x9a609
movl $0x4f7, %edx            # imm = 0x4F7
callq 0x4d0e5
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/aof.c
// Function: bgrewriteaofCommand
void bgrewriteaofCommand(redisClient *c) {

    // 不能重复运行 BGREWRITEAOF
    if (server.aof_child_pid != -1) {
        addReplyError(c,"Background append only file rewriting already in progress");

    // 如果正在执行 BGSAVE ，那么预定 BGREWRITEAOF
    // 等 BGSAVE 完成之后， BGREWRITEAOF 就会开始执行
    } else if (server.rdb_child_pid != -1) {
        server.aof_rewrite_scheduled = 1;
        addReplyStatus(c,"Background append only file rewriting scheduled");

    // 执行 BGREWRITEAOF
    } else if (rewriteAppendOnlyFileBackground() == REDIS_OK) {
        addReplyStatus(c,"Background append only file rewriting started");

    } else {
        addReply(c,shared.err);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7ebcd(%rip), %rax     # 0xc9fa8
cmpl $-0x1, 0x504(%rax)
je 0x4b3f4
leaq 0x4f946(%rip), %rsi     # 0x9ad31
movq %rbx, %rdi
popq %rbx
jmp 0x2d9d7
cmpl $-0x1, 0x570(%rax)
je 0x4b417
movl $0x1, 0x500(%rax)
leaq 0x4f95d(%rip), %rsi     # 0x9ad6b
movq %rbx, %rdi
popq %rbx
jmp 0x2db27
callq 0x49ae1
testl %eax, %eax
je 0x4b434
leaq 0x7f3d9(%rip), %rax     # 0xca800
movq 0x10(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2d6f0
leaq 0x4f960(%rip), %rsi     # 0x9ad9b
jmp 0x4b40e
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: pubsubSubscribeChannel
int pubsubSubscribeChannel(redisClient *c, robj *channel) {
    dictEntry *de;
    list *clients = NULL;
    int retval = 0;

    /* Add the channel to the client -> channels hash table */
    // 将 channels 填接到 c->pubsub_channels 的集合中（值为 NULL 的字典视为集合）
    if (dictAdd(c->pubsub_channels,channel,NULL) == DICT_OK) {
        retval = 1;
        incrRefCount(channel);

        // 关联示意图
        // {
        //  频道名        订阅频道的客户端
        //  'channel-a' : [c1, c2, c3],
        //  'channel-b' : [c5, c2, c1],
        //  'channel-c' : [c10, c2, c1]
        // }
        /* Add the client to the channel -> list of clients hash table */
        // 从 pubsub_channels 字典中取出保存着所有订阅了 channel 的客户端的链表
        // 如果 channel 不存在于字典，那么添加进去
        de = dictFind(server.pubsub_channels,channel);
        if (de == NULL) {
            clients = listCreate();
            dictAdd(server.pubsub_channels,channel,clients);
            incrRefCount(channel);
        } else {
            clients = dictGetVal(de);
        }

        // before:
        // 'channel' : [c1, c2]
        // after:
        // 'channel' : [c1, c2, c3]
        // 将客户端添加到链表的末尾
        listAddNodeTail(clients,c);
    }

    /* Notify the client */
    // 回复客户端。
    // 示例：
    // redis 127.0.0.1:6379> SUBSCRIBE xxx
    // Reading messages... (press Ctrl-C to quit)
    // 1) "subscribe"
    // 2) "xxx"
    // 3) (integer) 1
    addReply(c,shared.mbulkhdr[3]);
    // "subscribe\n" 字符串
    addReply(c,shared.subscribebulk);
    // 被订阅的客户端
    addReplyBulk(c,channel);
    // 客户端订阅的频道和模式总数
    addReplyLongLong(c,dictSize(c->pubsub_channels)+listLength(c->pubsub_patterns));

    return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x158(%rdi), %rdi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x222b6
testl %eax, %eax
jne 0x4b842
movq %r14, %rdi
callq 0x3041b
leaq 0x7e7b5(%rip), %r12     # 0xc9fa8
movq 0x7a8(%r12), %rdi
movq %r14, %rsi
callq 0x224dc
testq %rax, %rax
je 0x4b80e
movq 0x8(%rax), %r15
jmp 0x4b831
callq 0x2038c
movq %rax, %r15
movq 0x7a8(%r12), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x222b6
movq %r14, %rdi
callq 0x3041b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2045f
movl $0x1, %r15d
leaq 0x7efb7(%rip), %r12     # 0xca800
movq 0x13a48(%r12), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq 0x108(%r12), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2df74
movq 0x158(%rbx), %rax
movq 0x160(%rbx), %rcx
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
addq 0x28(%rcx), %rsi
movq %rbx, %rdi
callq 0x2dea3
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: pubsubSubscribePattern
int pubsubSubscribePattern(redisClient *c, robj *pattern) {
    int retval = 0;

    // 在链表中查找模式，看客户端是否已经订阅了这个模式
    // 这里为什么不像 channel 那样，用字典来进行检测呢？
    // 虽然 pattern 的数量一般来说并不多
    if (listSearchKey(c->pubsub_patterns,pattern) == NULL) {
        
        // 如果没有的话，执行以下代码

        retval = 1;

        pubsubPattern *pat;

        // 将 pattern 添加到 c->pubsub_patterns 链表中
        listAddNodeTail(c->pubsub_patterns,pattern);

        incrRefCount(pattern);

        // 创建并设置新的 pubsubPattern 结构
        pat = zmalloc(sizeof(*pat));
        pat->pattern = getDecodedObject(pattern);
        pat->client = c;

        // 添加到末尾
        listAddNodeTail(server.pubsub_patterns,pat);
    }

    /* Notify the client */
    // 回复客户端。
    // 示例：
    // redis 127.0.0.1:6379> PSUBSCRIBE xxx*
    // Reading messages... (press Ctrl-C to quit)
    // 1) "psubscribe"
    // 2) "xxx*"
    // 3) (integer) 1
    addReply(c,shared.mbulkhdr[3]);
    // 回复 "psubscribe" 字符串
    addReply(c,shared.psubscribebulk);
    // 回复被订阅的模式
    addReplyBulk(c,pattern);
    // 回复客户端订阅的频道和模式的总数
    addReplyLongLong(c,dictSize(c->pubsub_channels)+listLength(c->pubsub_patterns));

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x160(%rdi), %rdi
callq 0x206d5
xorl %ebp, %ebp
testq %rax, %rax
jne 0x4ba58
movq 0x160(%rbx), %rdi
movq %r14, %rsi
callq 0x2045f
movq %r14, %rdi
callq 0x3041b
movl $0x10, %edi
callq 0x29709
movq %rax, %r15
movq %r14, %rdi
callq 0x30ac3
movq %rax, 0x8(%r15)
movq %rbx, (%r15)
leaq 0x7e564(%rip), %rax     # 0xc9fa8
movq 0x7b0(%rax), %rdi
movq %r15, %rsi
callq 0x2045f
movl $0x1, %ebp
leaq 0x7eda1(%rip), %r15     # 0xca800
movq 0x13a48(%r15), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq 0x118(%r15), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2df74
movq 0x158(%rbx), %rax
movq 0x160(%rbx), %rcx
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
addq 0x28(%rcx), %rsi
movq %rbx, %rdi
callq 0x2dea3
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: pubsubUnsubscribePattern
int pubsubUnsubscribePattern(redisClient *c, robj *pattern, int notify) {
    listNode *ln;
    pubsubPattern pat;
    int retval = 0;

    incrRefCount(pattern); /* Protect the object. May be the same we remove */

    // 先确认一下，客户端是否订阅了这个模式
    if ((ln = listSearchKey(c->pubsub_patterns,pattern)) != NULL) {

        retval = 1;

        // 将模式从客户端的订阅列表中删除
        listDelNode(c->pubsub_patterns,ln);

        // 设置 pubsubPattern 结构
        pat.client = c;
        pat.pattern = pattern;

        // 在服务器中查找
        ln = listSearchKey(server.pubsub_patterns,&pat);
        listDelNode(server.pubsub_patterns,ln);
    }

    /* Notify the client */
    // 回复客户端
    if (notify) {
        addReply(c,shared.mbulkhdr[3]);
        // "punsubscribe" 字符串
        addReply(c,shared.punsubscribebulk);
        // 被退订的模式
        addReplyBulk(c,pattern);
        // 退订频道之后客户端仍在订阅的频道和模式的总数
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));
    }

    decrRefCount(pattern);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3041b
movq 0x160(%r14), %rdi
movq %rbx, %rsi
callq 0x206d5
testq %rax, %rax
je 0x4bb2a
movq 0x160(%r14), %rdi
movq %rax, %rsi
callq 0x20544
movq %rsp, %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x7e4a1(%rip), %r15     # 0xc9fa8
movq 0x7b0(%r15), %rdi
callq 0x206d5
movq 0x7b0(%r15), %rdi
movq %rax, %rsi
callq 0x20544
movl $0x1, %r15d
jmp 0x4bb2d
xorl %r15d, %r15d
testl %ebp, %ebp
je 0x4bb85
leaq 0x7ecc8(%rip), %r12     # 0xca800
movq 0x13a48(%r12), %rsi
movq %r14, %rdi
callq 0x2d6f0
movq 0x120(%r12), %rsi
movq %r14, %rdi
callq 0x2d6f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2df74
movq 0x158(%r14), %rax
movq 0x160(%r14), %rcx
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
addq 0x28(%rcx), %rsi
movq %r14, %rdi
callq 0x2dea3
movq %rbx, %rdi
callq 0x30834
movl %r15d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: pubsubUnsubscribeAllChannels
int pubsubUnsubscribeAllChannels(redisClient *c, int notify) {

    // 频道迭代器
    dictIterator *di = dictGetSafeIterator(c->pubsub_channels);
    dictEntry *de;
    int count = 0;

    // 退订
    while((de = dictNext(di)) != NULL) {
        robj *channel = dictGetKey(de);

        count += pubsubUnsubscribeChannel(c,channel,notify);
    }

    /* We were subscribed to nothing? Still reply to the client. */
    // 如果在执行这个函数时，客户端没有订阅任何频道，
    // 那么向客户端发送回复
    if (notify && count == 0) {
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.unsubscribebulk);
        addReply(c,shared.nullbulk);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));
    }

    dictReleaseIterator(di);

    // 被退订的频道的数量
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %r14
movq 0x158(%rdi), %rdi
callq 0x228e4
movq %rax, %rbx
movq %rax, %rdi
callq 0x22913
xorl %ebp, %ebp
testq %rax, %rax
je 0x4bbe2
movq (%rax), %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x4b8a5
addl %eax, %ebp
movq %rbx, %rdi
callq 0x22913
jmp 0x4bbc3
testl %r15d, %r15d
je 0x4bc3e
testl %ebp, %ebp
jne 0x4bc3e
leaq 0x7ec0e(%rip), %r15     # 0xca800
movq 0x13a48(%r15), %rsi
movq %r14, %rdi
callq 0x2d6f0
movq 0x110(%r15), %rsi
movq %r14, %rdi
callq 0x2d6f0
movq 0x50(%r15), %rsi
movq %r14, %rdi
callq 0x2d6f0
movq 0x158(%r14), %rax
movq 0x160(%r14), %rcx
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
addq 0x28(%rcx), %rsi
movq %r14, %rdi
callq 0x2dea3
movq %rbx, %rdi
callq 0x229b9
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: pubsubUnsubscribeAllPatterns
int pubsubUnsubscribeAllPatterns(redisClient *c, int notify) {
    listNode *ln;
    listIter li;
    int count = 0;

    // 迭代客户端订阅模式的链表
    listRewind(c->pubsub_patterns,&li);
    while ((ln = listNext(&li)) != NULL) {
        robj *pattern = ln->value;

        // 退订，并计算退订数
        count += pubsubUnsubscribePattern(c,pattern,notify);
    }

    // 如果在执行这个函数时，客户端没有订阅任何模式，
    // 那么向客户端发送回复
    if (notify && count == 0) {
        /* We were subscribed to nothing? Still reply to the client. */
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.punsubscribebulk);
        addReply(c,shared.nullbulk);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));
    }

    // 退订总数
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x160(%rdi), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x205d2
movq %r15, %rdi
callq 0x205ef
xorl %ebp, %ebp
testq %rax, %rax
je 0x4bca9
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x4bab7
addl %eax, %ebp
movq %r15, %rdi
callq 0x205ef
testq %rax, %rax
jne 0x4bc8b
testl %r14d, %r14d
je 0x4bd05
testl %ebp, %ebp
jne 0x4bd05
leaq 0x7eb47(%rip), %r14     # 0xca800
movq 0x13a48(%r14), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq 0x120(%r14), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq 0x50(%r14), %rsi
movq %rbx, %rdi
callq 0x2d6f0
movq 0x158(%rbx), %rax
movq 0x160(%rbx), %rcx
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
addq 0x28(%rcx), %rsi
movq %rbx, %rdi
callq 0x2dea3
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: unsubscribeCommand
void unsubscribeCommand(redisClient *c) {
    if (c->argc == 1) {
        pubsubUnsubscribeAllChannels(c,1);
    } else {
        int j;

        for (j = 1; j < c->argc; j++)
            pubsubUnsubscribeChannel(c,c->argv[j],1);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, 0x30(%rdi)
jne 0x4beef
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4bb9d
cmpl $0x2, 0x30(%rbx)
jl 0x4bf1c
movl $0x1, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4b8a5
incq %r14
movslq 0x30(%rbx), %rax
cmpq %rax, %r14
jl 0x4befb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: punsubscribeCommand
void punsubscribeCommand(redisClient *c) {
    if (c->argc == 1) {
        pubsubUnsubscribeAllPatterns(c,1);
    } else {
        int j;

        for (j = 1; j < c->argc; j++)
            pubsubUnsubscribePattern(c,c->argv[j],1);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, 0x30(%rdi)
jne 0x4bf7c
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4bc53
cmpl $0x2, 0x30(%rbx)
jl 0x4bfa9
movl $0x1, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4bab7
incq %r14
movslq 0x30(%rbx), %rax
cmpq %rax, %r14
jl 0x4bf88
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/pubsub.c
// Function: publishCommand
void publishCommand(redisClient *c) {

    int receivers = pubsubPublishMessage(c->argv[1],c->argv[2]);
    if (server.cluster_enabled)
        clusterPropagatePublish(c->argv[1],c->argv[2]);
    else
        forceCommandPropagation(c,REDIS_PROPAGATE_REPL);
    addReplyLongLong(c,receivers);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x4bd12
movl %eax, %ebp
leaq 0x7dfd7(%rip), %rax     # 0xc9fa8
cmpl $0x0, 0x7bc(%rax)
je 0x4bfed
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x5344b
jmp 0x4bffa
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25b1c
movslq %ebp, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2dea3
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: freeClientMultiState
void freeClientMultiState(redisClient *c) {
    int j;

    // 遍历事务队列
    for (j = 0; j < c->mstate.count; j++) {
        int i;
        multiCmd *mc = c->mstate.commands+j;

        // 释放所有命令参数
        for (i = 0; i < mc->argc; i++)
            decrRefCount(mc->argv[i]);

        // 释放参数数组本身
        zfree(mc->argv);
    }

    // 释放事务队列
    zfree(c->mstate.commands);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x108(%rdi)
jle 0x4c261
xorl %r14d, %r14d
movq 0x100(%rbx), %rax
leaq (%r14,%r14,2), %rcx
leaq (%rax,%rcx,8), %r15
cmpl $0x0, 0x8(%r15)
jle 0x4c24a
xorl %r12d, %r12d
movq (%r15), %rax
movq (%rax,%r12,8), %rdi
callq 0x30834
incq %r12
movslq 0x8(%r15), %rax
cmpq %rax, %r12
jl 0x4c232
movq (%r15), %rdi
callq 0x2984b
incq %r14
movslq 0x108(%rbx), %rax
cmpq %rax, %r14
jl 0x4c219
movq 0x100(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2984b
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: queueMultiCommand
void queueMultiCommand(redisClient *c) {
    multiCmd *mc;
    int j;

    // 为新数组元素分配空间
    c->mstate.commands = zrealloc(c->mstate.commands,
            sizeof(multiCmd)*(c->mstate.count+1));

    // 指向新元素
    mc = c->mstate.commands+c->mstate.count;

    // 设置事务的命令、命令参数数量，以及命令的参数
    mc->cmd = c->cmd;
    mc->argc = c->argc;
    mc->argv = zmalloc(sizeof(robj*)*c->argc);
    memcpy(mc->argv,c->argv,sizeof(robj*)*c->argc);
    for (j = 0; j < c->argc; j++)
        incrRefCount(mc->argv[j]);

    // 事务命令数量计数器增一
    c->mstate.count++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x100(%rdi), %rdi
movslq 0x108(%rbx), %rax
leaq (%rax,%rax,2), %rax
leaq 0x18(,%rax,8), %rsi
callq 0x297b5
movq %rax, %r14
movq %rax, 0x100(%rbx)
movslq 0x108(%rbx), %rax
leaq (%rax,%rax,2), %r15
movq 0x40(%rbx), %rax
movq %rax, 0x10(%r14,%r15,8)
movslq 0x30(%rbx), %rdi
movl %edi, 0x8(%r14,%r15,8)
shlq $0x3, %rdi
callq 0x29709
movq %rax, (%r14,%r15,8)
movq 0x38(%rbx), %rsi
movslq 0x30(%rbx), %rdx
shlq $0x3, %rdx
movq %rax, %rdi
callq 0x1fbd0
cmpl $0x0, 0x30(%rbx)
jle 0x4c30c
leaq (%r14,%r15,8), %r14
xorl %r15d, %r15d
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3041b
incq %r15
movslq 0x30(%rbx), %rax
cmpq %rax, %r15
jl 0x4c2f4
incl 0x108(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: unwatchAllKeys
void unwatchAllKeys(redisClient *c) {
    listIter li;
    listNode *ln;

    // 没有键被监视，直接返回
    if (listLength(c->watched_keys) == 0) return;

    // 遍历链表中所有被客户端监视的键
    listRewind(c->watched_keys,&li);
    while((ln = listNext(&li))) {
        list *clients;
        watchedKey *wk;

        /* Lookup the watched key -> clients list and remove the client
         * from the list */
        // 从数据库的 watched_keys 字典的 key 键中
        // 删除链表里包含的客户端节点
        wk = listNodeValue(ln);
        // 取出客户端链表
        clients = dictFetchValue(wk->db->watched_keys, wk->key);
        redisAssertWithInfo(c,NULL,clients != NULL);
        // 删除链表中的客户端节点
        listDelNode(clients,listSearchKey(clients,c));

        /* Kill the entry at all if this was the only client */
        // 如果链表已经被清空，那么删除这个键
        if (listLength(clients) == 0)
            dictDelete(wk->db->watched_keys, wk->key);

        /* Remove this watched key from the client->watched list */
        // 从链表中移除 key 节点
        listDelNode(c->watched_keys,ln);

        decrRefCount(wk->key);
        zfree(wk);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x150(%rdi), %rdi
cmpq $0x0, 0x28(%rdi)
je 0x4c40a
movq %rsp, %r14
movq %r14, %rsi
callq 0x205d2
movq %r14, %rdi
callq 0x205ef
testq %rax, %rax
je 0x4c40a
movq %rax, %r15
movq %rsp, %r14
movq 0x10(%r15), %r12
movq (%r12), %rsi
movq 0x8(%r12), %rax
movq 0x20(%rax), %rdi
callq 0x22813
testq %rax, %rax
je 0x4c418
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x206d5
movq %r13, %rdi
movq %rax, %rsi
callq 0x20544
cmpq $0x0, 0x28(%r13)
jne 0x4c3da
movq (%r12), %rsi
movq 0x8(%r12), %rax
movq 0x20(%rax), %rdi
callq 0x225d3
movq 0x150(%rbx), %rdi
movq %r15, %rsi
callq 0x20544
movq (%r12), %rdi
callq 0x30834
movq %r12, %rdi
callq 0x2984b
movq %r14, %rdi
callq 0x205ef
movq %rax, %r15
testq %rax, %rax
jne 0x4c38d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4ec8c(%rip), %rdx     # 0x9b0ab
leaq 0x4ec95(%rip), %rcx     # 0x9b0bb
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1a9, %r8d            # imm = 0x1A9
callq 0x4d872
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: discardCommand
void discardCommand(redisClient *c) {

    // 不能在客户端未进行事务状态之前使用
    if (!(c->flags & REDIS_MULTI)) {
        addReplyError(c,"DISCARD without MULTI");
        return;
    }

    discardTransaction(c);

    addReply(c,shared.ok);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x8, 0x90(%rdi)
jne 0x4c4a2
leaq 0x4ebe9(%rip), %rsi     # 0x9b082
movq %rbx, %rdi
popq %rbx
jmp 0x2d9d7
movq %rbx, %rdi
callq 0x4c202
movq $0x0, 0x100(%rbx)
movl $0x0, 0x108(%rbx)
andl $0xffffefd7, 0x90(%rbx) # imm = 0xFFFFEFD7
movq %rbx, %rdi
callq 0x4c349
leaq 0x7e328(%rip), %rax     # 0xca800
movq 0x8(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2d6f0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: execCommandPropagateMulti
void execCommandPropagateMulti(redisClient *c) {
    robj *multistring = createStringObject("MULTI",5);

    propagate(server.multiCommand,c->db->id,&multistring,1,
              REDIS_PROPAGATE_AOF|REDIS_PROPAGATE_REPL);

    decrRefCount(multistring);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4ebb2(%rip), %rdi     # 0x9b0a5
movl $0x5, %esi
callq 0x303b7
movq %rsp, %r14
movq %rax, (%r14)
leaq 0x7da9e(%rip), %rax     # 0xc9fa8
movq 0x320(%rax), %rdi
movq 0x8(%rbx), %rax
movl 0x30(%rax), %esi
movq %r14, %rdx
movl $0x1, %ecx
movl $0x3, %r8d
callq 0x25a57
movq (%r14), %rdi
callq 0x30834
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: touchWatchedKey
void touchWatchedKey(redisDb *db, robj *key) {
    list *clients;
    listIter li;
    listNode *ln;

    // 字典为空，没有任何键被监视
    if (dictSize(db->watched_keys) == 0) return;

    // 获取所有监视这个键的客户端
    clients = dictFetchValue(db->watched_keys, key);
    if (!clients) return;

    /* Mark all the clients watching this key as REDIS_DIRTY_CAS */
    /* Check if we are already watching for this key */
    // 遍历所有客户端，打开他们的 REDIS_DIRTY_CAS 标识
    listRewind(clients,&li);
    while((ln = listNext(&li))) {
        redisClient *c = listNodeValue(ln);

        c->flags |= REDIS_DIRTY_CAS;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq 0x20(%rdi), %rdi
movq 0x28(%rdi), %rax
addq 0x48(%rdi), %rax
je 0x4c88c
callq 0x22813
testq %rax, %rax
je 0x4c88c
movq %rsp, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x205d2
movq %rbx, %rdi
callq 0x205ef
testq %rax, %rax
je 0x4c88c
movq %rsp, %rbx
movq 0x10(%rax), %rax
orl $0x20, 0x90(%rax)
movq %rbx, %rdi
callq 0x205ef
testq %rax, %rax
jne 0x4c874
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: touchWatchedKeysOnFlush
void touchWatchedKeysOnFlush(int dbid) {
    listIter li1, li2;
    listNode *ln;

    // 这里的思路挺有趣的，不是遍历数据库的所有 key 来让客户端变为 DIRTY
    // 而是遍历所有客户端，然后遍历客户端监视的键，再让相应的客户端变为 DIRTY
    // 后者要比前者高效很多

    /* For every client, check all the waited keys */
    // 遍历所有客户端
    listRewind(server.clients,&li1);
    while((ln = listNext(&li1))) {

        redisClient *c = listNodeValue(ln);

        // 遍历客户端监视的键
        listRewind(c->watched_keys,&li2);
        while((ln = listNext(&li2))) {

            // 取出监视的键和键的数据库
            watchedKey *wk = listNodeValue(ln);

            /* For every watched key matching the specified DB, if the
             * key exists, mark the client as dirty, as the key will be
             * removed. */
            // 如果数据库号码相同，或者执行的命令为 FLUSHALL
            // 那么将客户端设置为 REDIS_DIRTY_CAS
            if (dbid == -1 || wk->db->id == dbid) {
                if (dictFind(wk->db->dict, wk->key->ptr) != NULL)
                    c->flags |= REDIS_DIRTY_CAS;
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
leaq 0x7d702(%rip), %rax     # 0xc9fa8
movq 0x1b0(%rax), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x205d2
movq %r14, %rdi
callq 0x205ef
testq %rax, %rax
je 0x4c934
leaq 0x18(%rsp), %r14
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %r12
movq 0x150(%r12), %rdi
movq %r14, %rsi
callq 0x205d2
movq %r14, %rdi
callq 0x205ef
testq %rax, %rax
je 0x4c927
movq 0x10(%rax), %rax
cmpl $-0x1, %ebx
je 0x4c904
movq 0x8(%rax), %rcx
cmpl %ebx, 0x30(%rcx)
jne 0x4c8e5
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq 0x8(%rcx), %rsi
callq 0x224dc
testq %rax, %rax
je 0x4c8e5
orb $0x20, 0x90(%r12)
jmp 0x4c8e5
movq %r15, %rdi
callq 0x205ef
testq %rax, %rax
jne 0x4c8d1
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: watchCommand
void watchCommand(redisClient *c) {
    int j;

    // 不能在事务开始后执行
    if (c->flags & REDIS_MULTI) {
        addReplyError(c,"WATCH inside MULTI is not allowed");
        return;
    }

    // 监视输入的任意个键
    for (j = 1; j < c->argc; j++)
        watchForKey(c,c->argv[j]);

    addReply(c,shared.ok);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x8, 0x90(%rdi)
jne 0x4c992
cmpl $0x2, 0x30(%rbx)
jl 0x4c978
movl $0x1, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
callq 0x4c75b
incq %r14
movslq 0x30(%rbx), %rax
cmpq %rax, %r14
jl 0x4c95c
leaq 0x7de81(%rip), %rax     # 0xca800
movq 0x8(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2d6f0
leaq 0x4e72a(%rip), %rsi     # 0x9b0c3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2d9d7
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/multi.c
// Function: unwatchCommand
void unwatchCommand(redisClient *c) {

    // 取消客户端对所有键的监视
    unwatchAllKeys(c);
    
    // 重置状态
    c->flags &= (~REDIS_DIRTY_CAS);

    addReply(c,shared.ok);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4c349
andb $-0x21, 0x90(%rbx)
leaq 0x7de41(%rip), %rax     # 0xca800
movq 0x8(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x2d6f0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: redisAssert
void _redisAssert(char *estr, char *file, int line) {
    bugReportStart();
    redisLog(REDIS_WARNING,"=== ASSERTION FAILED ===");
    redisLog(REDIS_WARNING,"==> %s:%d '%s' is not true",file,line,estr);
#ifdef HAVE_BACKTRACE
    server.assert_failed = estr;
    server.assert_file = file;
    server.assert_line = line;
    redisLog(REDIS_WARNING,"(forcing SIGSEGV to print the bug report.)");
#endif
    *((char*)-1) = 'x';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x7cf5a(%rip), %r12     # 0xc9fa8
cmpl $0x0, 0x834(%r12)
jne 0x4d078
leaq 0x4e5a9(%rip), %rsi     # 0x9b609
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl $0x1, 0x834(%r12)
leaq 0x4e2e4(%rip), %rsi     # 0x9b363
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
leaq 0x4e2ea(%rip), %rsi     # 0x9b37c
movl $0x3, %edi
movq %r14, %rdx
movl %ebx, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x23064
movq %r15, 0x820(%r12)
movq %r14, 0x828(%r12)
movl %ebx, 0x830(%r12)
leaq 0x4e2d2(%rip), %rsi     # 0x9b397
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movb $0x78, -0x1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: redisPanic
void _redisPanic(char *msg, char *file, int line) {
    bugReportStart();
    redisLog(REDIS_WARNING,"------------------------------------------------");
    redisLog(REDIS_WARNING,"!!! Software Failure. Press left mouse button to continue");
    redisLog(REDIS_WARNING,"Guru Meditation: %s #%s:%d",msg,file,line);
#ifdef HAVE_BACKTRACE
    redisLog(REDIS_WARNING,"(forcing SIGSEGV in order to print the stack trace)");
#endif
    redisLog(REDIS_WARNING,"------------------------------------------------");
    *((char*)-1) = 'x';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x7ceac(%rip), %r12     # 0xc9fa8
cmpl $0x0, 0x834(%r12)
jne 0x4d126
leaq 0x4e4fb(%rip), %rsi     # 0x9b609
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl $0x1, 0x834(%r12)
leaq 0x4e422(%rip), %r12     # 0x9b54f
movl $0x3, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x23064
leaq 0x4e43d(%rip), %rsi     # 0x9b580
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
leaq 0x4e464(%rip), %rsi     # 0x9b5ba
movl $0x3, %edi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x23064
leaq 0x4e463(%rip), %rsi     # 0x9b5d5
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl $0x3, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x23064
movb $0x78, -0x1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: bugReportStart
void bugReportStart(void) {
    if (server.bug_report_start == 0) {
        redisLog(REDIS_WARNING,
            "\n\n=== REDIS BUG REPORT START: Cut & paste starting from here ===");
        server.bug_report_start = 1;
    }
}

// Assembly:
pushq %rbx
leaq 0x7c6eb(%rip), %rbx     # 0xc9fa8
cmpl $0x0, 0x834(%rbx)
jne 0x4d8e3
leaq 0x4dd3c(%rip), %rsi     # 0x9b609
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl $0x1, 0x834(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: redisAssertPrintClientInfo
void _redisAssertPrintClientInfo(redisClient *c) {
    int j;

    bugReportStart();
    redisLog(REDIS_WARNING,"=== ASSERTION FAILED CLIENT CONTEXT ===");
    redisLog(REDIS_WARNING,"client->flags = %d", c->flags);
    redisLog(REDIS_WARNING,"client->fd = %d", c->fd);
    redisLog(REDIS_WARNING,"client->argc = %d", c->argc);
    for (j=0; j < c->argc; j++) {
        char buf[128];
        char *arg;

        if (c->argv[j]->type == REDIS_STRING && sdsEncodedObject(c->argv[j])) {
            arg = (char*) c->argv[j]->ptr;
        } else {
            snprintf(buf,sizeof(buf),"Object type: %d, encoding: %d",
                c->argv[j]->type, c->argv[j]->encoding);
            arg = buf;
        }
        redisLog(REDIS_WARNING,"client->argv[%d] = \"%s\" (refcount: %d)",
            j, arg, c->argv[j]->refcount);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x7c6a9(%rip), %r14     # 0xc9fa8
cmpl $0x0, 0x834(%r14)
jne 0x4d927
leaq 0x4dcf9(%rip), %rsi     # 0x9b609
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl $0x1, 0x834(%r14)
leaq 0x4da94(%rip), %rsi     # 0x9b3c2
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl 0x90(%rbx), %edx
leaq 0x4daa3(%rip), %rsi     # 0x9b3ea
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl (%rbx), %edx
leaq 0x4daa1(%rip), %rsi     # 0x9b3fd
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl 0x30(%rbx), %edx
leaq 0x4da9b(%rip), %rsi     # 0x9b40d
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
cmpl $0x0, 0x30(%rbx)
jle 0x4da03
leaq 0x4dab2(%rip), %r14     # 0x9b43d
leaq 0x4da8d(%rip), %r15     # 0x9b41f
movq %rsp, %r12
xorl %r13d, %r13d
movq 0x38(%rbx), %rax
movq (%rax,%r13,8), %rax
movl (%rax), %r8d
movl %r8d, %ecx
andl $0xf, %ecx
je 0x4d9ca
shrl $0x4, %r8d
andl $0xf, %r8d
movl $0x80, %esi
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1f120
movq %r12, %rcx
jmp 0x4d9d9
movl %r8d, %edx
shrl $0x4, %edx
testb $0x7, %dl
jne 0x4d9ab
movq 0x8(%rax), %rcx
movq 0x38(%rbx), %rax
movq (%rax,%r13,8), %rax
movl 0x4(%rax), %r8d
movl $0x3, %edi
movq %r14, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x23064
incq %r13
movslq 0x30(%rbx), %rax
cmpq %rax, %r13
jl 0x4d998
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: redisLogObjectDebugInfo
void redisLogObjectDebugInfo(robj *o) {
    redisLog(REDIS_WARNING,"Object type: %d", o->type);
    redisLog(REDIS_WARNING,"Object encoding: %d", o->encoding);
    redisLog(REDIS_WARNING,"Object refcount: %d", o->refcount);
    if (o->type == REDIS_STRING && sdsEncodedObject(o)) {
        redisLog(REDIS_WARNING,"Object raw string len: %zu", sdslen(o->ptr));
        if (sdslen(o->ptr) < 4096) {
            sds repr = sdscatrepr(sdsempty(),o->ptr,sdslen(o->ptr));
            redisLog(REDIS_WARNING,"Object raw string content: %s", repr);
            sdsfree(repr);
        }
    } else if (o->type == REDIS_LIST) {
        redisLog(REDIS_WARNING,"List length: %d", (int) listTypeLength(o));
    } else if (o->type == REDIS_SET) {
        redisLog(REDIS_WARNING,"Set size: %d", (int) setTypeSize(o));
    } else if (o->type == REDIS_HASH) {
        redisLog(REDIS_WARNING,"Hash size: %d", (int) hashTypeLength(o));
    } else if (o->type == REDIS_ZSET) {
        redisLog(REDIS_WARNING,"Sorted set size: %d", (int) zsetLength(o));
        if (o->encoding == REDIS_ENCODING_SKIPLIST)
            redisLog(REDIS_WARNING,"Skiplist level: %d", (int) ((zset*)o->ptr)->zsl->level);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edx
andl $0xf, %edx
leaq 0x4da40(%rip), %rsi     # 0x9b464
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl (%rbx), %edx
shrl $0x4, %edx
andl $0xf, %edx
leaq 0x4da35(%rip), %rsi     # 0x9b474
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl 0x4(%rbx), %edx
leaq 0x4da33(%rip), %rsi     # 0x9b488
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movl (%rbx), %ecx
movl %ecx, %eax
andl $0xf, %eax
cmpl $0x4, %eax
ja 0x4db56
leaq 0x4d684(%rip), %rdx     # 0x9b0fc
movslq (%rdx,%rax,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x4daec
movq 0x8(%rbx), %rax
movslq -0x8(%rax), %rdx
leaq 0x4da04(%rip), %rsi     # 0x9b49c
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movq 0x8(%rbx), %rax
cmpl $0xfff, -0x8(%rax)      # imm = 0xFFF
ja 0x4db56
callq 0x281b2
movq 0x8(%rbx), %rsi
movslq -0x8(%rsi), %rdx
movq %rax, %rdi
callq 0x28f45
movq %rax, %rbx
leaq 0x4d9e3(%rip), %rsi     # 0x9b4b7
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x23064
movq %rbx, %rdi
popq %rbx
jmp 0x28204
decl %eax
cmpl $0x3, %eax
ja 0x4db56
leaq 0x4d616(%rip), %rcx     # 0x9b110
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x398e9
leaq 0x4d9c3(%rip), %rsi     # 0x9b4d5
jmp 0x4db78
movq %rbx, %rdi
callq 0x3ea49
leaq 0x4d9dd(%rip), %rsi     # 0x9b500
movl $0x3, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x23064
movl $0xf0, %eax
andl (%rbx), %eax
cmpl $0x70, %eax
jne 0x4db56
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rax
movl 0x18(%rax), %edx
leaq 0x4d9c5(%rip), %rsi     # 0x9b514
movl $0x3, %edi
jmp 0x4db7f
popq %rbx
retq
movq %rbx, %rdi
callq 0x4274d
leaq 0x4d98b(%rip), %rsi     # 0x9b4f2
jmp 0x4db78
movq %rbx, %rdi
callq 0x3bb8a
leaq 0x4d96d(%rip), %rsi     # 0x9b4e5
movl $0x3, %edi
movl %eax, %edx
xorl %eax, %eax
popq %rbx
jmp 0x23064
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: logStackContent
void logStackContent(void **sp) {
    int i;
    for (i = 15; i >= 0; i--) {
        unsigned long addr = (unsigned long) sp+i;
        unsigned long val = (unsigned long) sp[i];

        if (sizeof(long) == 4)
            redisLog(REDIS_WARNING, "(%08lx) -> %08lx", addr, val);
        else
            redisLog(REDIS_WARNING, "(%016lx) -> %016lx", addr, val);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xf, %r15d
leaq 0x4da56(%rip), %r14     # 0x9b64a
leaq (%rbx,%r15), %rdx
movq (%rbx,%r15,8), %rcx
movl $0x3, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x23064
addq $-0x1, %r15
jb 0x4dbf4
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: logCurrentClient
void logCurrentClient(void) {
    if (server.current_client == NULL) return;

    redisClient *cc = server.current_client;
    sds client;
    int j;

    redisLog(REDIS_WARNING, "--- CURRENT CLIENT INFO");
    client = catClientInfoString(sdsempty(),cc);
    redisLog(REDIS_WARNING,"client: %s", client);
    sdsfree(client);
    for (j = 0; j < cc->argc; j++) {
        robj *decoded;

        decoded = getDecodedObject(cc->argv[j]);
        redisLog(REDIS_WARNING,"argv[%d]: '%s'", j, (char*)decoded->ptr);
        decrRefCount(decoded);
    }
    /* Check if the first argument, usually a key, is found inside the
     * selected DB, and if so print info about the associated object. */
    if (cc->argc >= 1) {
        robj *val, *key;
        dictEntry *de;

        key = getDecodedObject(cc->argv[1]);
        de = dictFind(cc->db->dict, key->ptr);
        if (de) {
            val = dictGetVal(de);
            redisLog(REDIS_WARNING,"key '%s' found in DB containing the following object:", (char*)key->ptr);
            redisLogObjectDebugInfo(val);
        }
        decrRefCount(key);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7c1ab(%rip), %rax     # 0xc9fa8
movq 0x1d0(%rax), %rbx
testq %rbx, %rbx
je 0x4defe
leaq 0x4d92c(%rip), %rsi     # 0x9b740
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
callq 0x281b2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2ee21
movq %rax, %r14
leaq 0x4917f(%rip), %rsi     # 0x96fb9
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x23064
movq %r14, %rdi
callq 0x28204
cmpl $0x0, 0x30(%rbx)
jle 0x4defe
leaq 0x4d8f6(%rip), %r14     # 0x9b758
xorl %r15d, %r15d
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x30ac3
movq %rax, %r12
movq 0x8(%rax), %rcx
movl $0x3, %edi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x23064
movq %r12, %rdi
callq 0x30834
incq %r15
movslq 0x30(%rbx), %rax
cmpq %rax, %r15
jl 0x4de65
testl %eax, %eax
jle 0x4defe
movq 0x38(%rbx), %rax
movq 0x8(%rax), %rdi
callq 0x30ac3
movq %rax, %r14
movq 0x8(%rbx), %rax
movq (%rax), %rdi
movq 0x8(%r14), %rsi
callq 0x224dc
testq %rax, %rax
je 0x4deeb
movq 0x8(%rax), %rbx
movq 0x8(%r14), %rdx
leaq 0x4d890(%rip), %rsi     # 0x9b767
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
movq %rbx, %rdi
callq 0x4da14
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x30834
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/debug.c
// Function: redisLogHexDump
void redisLogHexDump(int level, char *descr, void *value, size_t len) {
    char buf[65], *b;
    unsigned char *v = value;
    char charset[] = "0123456789abcdef";

    redisLog(level,"%s (hexdump):", descr);
    b = buf;
    while(len) {
        b[0] = charset[(*v)>>4];
        b[1] = charset[(*v)&0xf];
        b[2] = '\0';
        b += 2;
        len--;
        v++;
        if (b-buf == 64 || len == 0) {
            redisLogRaw(level|REDIS_LOG_RAW,buf);
            b = buf;
        }
    }
    redisLogRaw(level|REDIS_LOG_RAW,"\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rdx
leaq 0x4d64d(%rip), %rsi     # 0x9ba2b
movl %edi, (%rsp)
xorl %eax, %eax
callq 0x23064
testq %r14, %r14
je 0x4e472
movl (%rsp), %eax
orl $0x400, %eax            # imm = 0x400
movl %eax, 0x4(%rsp)
leaq -0x1(%r14), %r13
leaq 0x10(%rsp), %rbp
xorl %ebx, %ebx
leaq 0x4d661(%rip), %r12     # 0x9ba70
movq %rbp, %rcx
negq %rcx
movq %rcx, 0x8(%rsp)
movzbl (%r15,%rbx), %ecx
shrl $0x4, %ecx
movb (%rcx,%r12), %cl
movb %cl, (%rbp)
movzbl (%r15,%rbx), %ecx
andl $0xf, %ecx
movb (%rcx,%r12), %cl
movb %cl, 0x1(%rbp)
movb $0x0, 0x2(%rbp)
cmpq %rbx, %r13
je 0x4e459
movq 0x8(%rsp), %rcx
addq %rbp, %rcx
addq $0x2, %rcx
cmpq $0x40, %rcx
je 0x4e459
addq $0x2, %rbp
jmp 0x4e46a
movl 0x4(%rsp), %edi
leaq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0x22f15
incq %rbx
cmpq %rbx, %r14
jne 0x4e41a
movl (%rsp), %edi
orl $0x400, %edi            # imm = 0x400
leaq 0x482bf(%rip), %rsi     # 0x96741
callq 0x22f15
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/sort.c
// Function: createSortOperation
redisSortOperation *createSortOperation(int type, robj *pattern) {

    redisSortOperation *so = zmalloc(sizeof(*so));

    so->type = type;
    so->pattern = pattern;

    return so;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movl $0x10, %edi
callq 0x29709
movl %ebp, (%rax)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq