LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplySds
void addReplySds(redisClient *c, sds s) {
    if (prepareClientToWrite(c) != REDIS_OK) {
        /* The caller expects the sds to be free'd. */
        sdsfree(s);
        return;
    }
    if (_addReplyToBuffer(c,s,sdslen(s)) == REDIS_OK) {
        sdsfree(s);
    } else {
        /* This method free's the sds when it is no longer needed. */
        _addReplySdsToList(c,s);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2bb2e
testl %eax, %eax
je 0x2c231
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x271f7
movslq -0x8(%rbx), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2bddc
testl %eax, %eax
je 0x2c222
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2bf85
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyStatusFormat
void addReplyStatusFormat(redisClient *c, const char *fmt, ...) {
    va_list ap;
    va_start(ap,fmt);
    sds s = sdscatvprintf(sdsempty(),fmt,ap);
    va_end(ap);
    addReplyStatusLength(c,s,sdslen(s));
    sdsfree(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2c4ac
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r15
movq %rsi, 0x10(%r15)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r15)
callq 0x271bf
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x27559
movq %rax, %rbx
movslq -0x8(%rax), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2c3e1
movq %rbx, %rdi
callq 0x271f7
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addDeferredMultiBulkLength
void *addDeferredMultiBulkLength(redisClient *c) {
    /* Note that we install the write event here even if the object is not
     * ready to be sent, since we are sure that before returning to the
     * event loop setDeferredMultiBulkLength() will be called. */
    if (prepareClientToWrite(c) != REDIS_OK) return NULL;
    listAddNodeTail(c->reply,createObject(REDIS_STRING,NULL));
    return listLast(c->reply);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2bb2e
testl %eax, %eax
je 0x2c51a
xorl %eax, %eax
jmp 0x2c53a
movq 0x60(%rbx), %r14
xorl %edi, %edi
xorl %esi, %esi
callq 0x2e9b4
movq %r14, %rdi
movq %rax, %rsi
callq 0x1fe4c
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: setDeferredMultiBulkLength
void setDeferredMultiBulkLength(redisClient *c, void *node, long length) {
    listNode *ln = (listNode*)node;
    robj *len, *next;

    /* Abort when *node is NULL (see addDeferredMultiBulkLength). */
    if (node == NULL) return;

    len = listNodeValue(ln);
    len->ptr = sdscatprintf(sdsempty(),"*%ld\r\n",length);
    len->encoding = REDIS_ENCODING_RAW; /* in case it was an EMBSTR. */
    c->reply_bytes += zmalloc_size_sds(len->ptr);
    if (ln->next != NULL) {
        next = listNodeValue(ln->next);

        /* Only glue when the next node is non-NULL (an sds in this case) */
        if (next->ptr != NULL) {
            c->reply_bytes -= zmalloc_size_sds(len->ptr);
            c->reply_bytes -= getStringObjectSdsUsedMemory(next);
            len->ptr = sdscatlen(len->ptr,next->ptr,sdslen(next->ptr));
            c->reply_bytes += zmalloc_size_sds(len->ptr);
            listDelNode(c->reply,ln->next);
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
testq %rsi, %rsi
je 0x2c606
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r12
callq 0x271bf
leaq 0x6084f(%rip), %rsi     # 0x8cdbb
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2763d
movq %rax, 0x8(%r12)
andb $0xf, (%r12)
leaq -0x8(%rax), %rdi
callq 0x76897
addq %rax, 0x68(%rbx)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x2c5f3
movq 0x10(%rax), %r15
cmpq $0x0, 0x8(%r15)
je 0x2c5f3
movq 0x8(%r12), %rdi
addq $-0x8, %rdi
callq 0x76897
subq %rax, 0x68(%rbx)
movq %r15, %rdi
callq 0x2b76d
subq %rax, 0x68(%rbx)
movq 0x8(%r12), %rdi
movq 0x8(%r15), %rsi
movslq -0x8(%rsi), %rdx
callq 0x2736d
movq %rax, 0x8(%r12)
leaq -0x8(%rax), %rdi
callq 0x76897
addq %rax, 0x68(%rbx)
movq 0x60(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x1ff28
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2bef2
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyBulkCString
void addReplyBulkCString(redisClient *c, char *s) {
    if (s == NULL) {
        addReply(c,shared.nullbulk);
    } else {
        addReplyBulkCBuffer(c,s,strlen(s));
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x2c6e0
movq %rsi, %r14
movq %rsi, %rdi
callq 0x1f4f0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2c87d
leaq 0x9b119(%rip), %rax     # 0xc7800
movq 0x50(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2c10d
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyLongLongWithPrefix
void addReplyLongLongWithPrefix(redisClient *c, long long ll, char prefix) {
    char buf[128];
    int len;

    /* Things like $3\r\n or *2\r\n are emitted very often by the protocol
     * so we have a few shared objects to use if the integer is small
     * like it is most of the times. */
    if (prefix == '*' && ll < REDIS_SHARED_BULKHDR_LEN) {
        // 多条批量回复
        addReply(c,shared.mbulkhdr[ll]);
        return;
    } else if (prefix == '$' && ll < REDIS_SHARED_BULKHDR_LEN) {
        // 批量回复
        addReply(c,shared.bulkhdr[ll]);
        return;
    }

    buf[0] = prefix;
    len = ll2string(buf+1,sizeof(buf)-1,ll);
    buf[len+1] = '\r';
    buf[len+2] = '\n';
    addReplyString(c,buf,len+3);
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rax
movq %rdi, %rbx
cmpb $0x2a, %dl
setne %cl
cmpq $0x20, %rsi
setge %sil
orb %cl, %sil
jne 0x2c72c
leaq 0x9b0de(%rip), %rcx     # 0xc7800
movq 0x13a30(%rcx,%rax,8), %rsi
jmp 0x2c74e
cmpq $0x20, %rax
setge %cl
cmpb $0x24, %dl
setne %sil
orb %cl, %sil
jne 0x2c75e
leaq 0x9b0ba(%rip), %rcx     # 0xc7800
movq 0x13b30(%rcx,%rax,8), %rsi
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
jmp 0x2c10d
leaq 0x1(%rsp), %rdi
movb %dl, -0x1(%rdi)
pushq $0x7f
popq %rsi
movq %rax, %rdx
callq 0x2e511
cltq
movq %rsp, %rsi
movw $0xa0d, 0x1(%rax,%rsi)  # imm = 0xA0D
addl $0x3, %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x2c256
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyLongLong
void addReplyLongLong(redisClient *c, long long ll) {
    if (ll == 0)
        addReply(c,shared.czero);
    else if (ll == 1)
        addReply(c,shared.cone);
    else
        addReplyLongLongWithPrefix(c,ll,':');
}

// Assembly:
cmpq $0x1, %rsi
je 0x2c7af
testq %rsi, %rsi
jne 0x2c7bf
leaq 0x9b05a(%rip), %rax     # 0xc7800
movq 0x20(%rax), %rsi
jmp 0x2c10d
leaq 0x9b04a(%rip), %rax     # 0xc7800
movq 0x28(%rax), %rsi
jmp 0x2c10d
pushq $0x3a
popq %rdx
jmp 0x2c6fa
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: copyClientOutputBuffer
void copyClientOutputBuffer(redisClient *dst, redisClient *src) {

    // 释放 dst 原有的回复链表
    listRelease(dst->reply);
    // 复制新链表到 dst
    dst->reply = listDup(src->reply);

    // 复制内容到回复 buf
    memcpy(dst->buf,src->buf,src->bufpos);

    // 同步偏移量和字节数
    dst->bufpos = src->bufpos;
    dst->reply_bytes = src->reply_bytes;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x60(%rdi), %rdi
callq 0x1fdaa
movq 0x60(%rbx), %rdi
callq 0x1ffdf
movq %rax, 0x60(%r14)
movl $0x174, %esi            # imm = 0x174
leaq (%r14,%rsi), %rdi
addq %rbx, %rsi
movslq 0x170(%rbx), %rdx
callq 0x1fbd0
movl 0x170(%rbx), %eax
movl %eax, 0x170(%r14)
movq 0x68(%rbx), %rax
movq %rax, 0x68(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: acceptTcpHandler
void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    int cport, cfd, max = MAX_ACCEPTS_PER_CALL;
    char cip[REDIS_IP_STR_LEN];
    REDIS_NOTUSED(el);
    REDIS_NOTUSED(mask);
    REDIS_NOTUSED(privdata);

    while(max--) {
        // accept 客户端连接
        cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
        if (cfd == ANET_ERR) {
            if (errno != EWOULDBLOCK)
                redisLog(REDIS_WARNING,
                    "Accepting client connection: %s", server.neterr);
            return;
        }
        redisLog(REDIS_VERBOSE,"Accepted %s:%d", cip, cport);
        // 为客户端创建客户端状态（redisClient）
        acceptCommonHandler(cfd,0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
movl $0x1e8, %r14d           # imm = 0x1E8
addq 0x96654(%rip), %r14     # 0xc2fb8
leaq 0x10(%rsp), %r15
pushq $0x1
popq %rbp
testl %r13d, %r13d
je 0x2c9db
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
pushq $0x2e
popq %rcx
leaq 0xc(%rsp), %r8
callq 0x21389
cmpl $-0x1, %eax
je 0x2c9b4
movl %eax, %r12d
movl 0xc(%rsp), %ecx
movl %ebp, %edi
leaq 0x60452(%rip), %rsi     # 0x8cded
movq %r15, %rdx
xorl %eax, %eax
callq 0x22613
movl %r12d, %edi
xorl %esi, %esi
callq 0x2c9ea
incl %r13d
jmp 0x2c96c
callq 0x1f810
cmpl $0xb, (%rax)
je 0x2c9db
movl $0x1e8, %edx            # imm = 0x1E8
addq 0x965ee(%rip), %rdx     # 0xc2fb8
leaq 0x603fc(%rip), %rsi     # 0x8cdcd
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x22613
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: acceptUnixHandler
void acceptUnixHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    int cfd, max = MAX_ACCEPTS_PER_CALL;
    REDIS_NOTUSED(el);
    REDIS_NOTUSED(mask);
    REDIS_NOTUSED(privdata);

    while(max--) {
        // accept 本地客户端连接
        cfd = anetUnixAccept(server.neterr, fd);
        if (cfd == ANET_ERR) {
            if (errno != EWOULDBLOCK)
                redisLog(REDIS_WARNING,
                    "Accepting client connection: %s", server.neterr);
            return;
        }
        redisLog(REDIS_VERBOSE,"Accepted connection to %s", server.unixsocket);
        // 为本地客户端创建客户端状态
        acceptCommonHandler(cfd,REDIS_UNIX_SOCKET);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl $0x1e8, %r14d           # imm = 0x1E8
addq 0x9651f(%rip), %r14     # 0xc2fb8
movl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
leaq 0x60356(%rip), %r15     # 0x8cdfc
pushq $0x1
popq %rbp
testl %r13d, %r13d
je 0x2caf6
movq %r14, %rdi
movl %ebx, %esi
callq 0x21463
cmpl $-0x1, %eax
je 0x2caec
movl %eax, %r12d
leaq 0x9a4e1(%rip), %rax     # 0xc6fa8
movq 0x118(%rax), %rdx
movl %ebp, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x22613
movl %r12d, %edi
movl $0x800, %esi            # imm = 0x800
callq 0x2c9ea
incl %r13d
jmp 0x2caa9
callq 0x1f810
cmpl $0xb, (%rax)
jne 0x2cb05
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1e8, %edx            # imm = 0x1E8
addq 0x964a7(%rip), %rdx     # 0xc2fb8
leaq 0x602b5(%rip), %rsi     # 0x8cdcd
pushq $0x3
popq %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22613
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: freeClientArgv
static void freeClientArgv(redisClient *c) {
    int j;
    for (j = 0; j < c->argc; j++)
        decrRefCount(c->argv[j]);
    c->argc = 0;
    c->cmd = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x30(%rbx), %rax
cmpq %rax, %r14
jge 0x2cec8
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x2ee1f
incq %r14
jmp 0x2cead
andl $0x0, 0x30(%rbx)
andq $0x0, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: freeClientsInAsyncFreeQueue
void freeClientsInAsyncFreeQueue(void) {
    
    // 遍历所有要关闭的客户端
    while (listLength(server.clients_to_close)) {
        listNode *ln = listFirst(server.clients_to_close);
        redisClient *c = listNodeValue(ln);

        c->flags &= ~REDIS_CLOSE_ASAP;
        // 关闭客户端
        freeClient(c);
        // 从客户端链表中删除被关闭的客户端
        listDelNode(server.clients_to_close,ln);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x9a096(%rip), %r14     # 0xc6fa8
movq 0x1b8(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0x2cf47
movq (%rax), %rbx
movq 0x10(%rbx), %rdi
andl $0xfffffbff, 0x90(%rdi) # imm = 0xFFFFFBFF
callq 0x2cb56
movq 0x1b8(%r14), %rdi
movq %rbx, %rsi
callq 0x1ff28
jmp 0x2cf12
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: resetClient
void resetClient(redisClient *c) {
    redisCommandProc *prevcmd = c->cmd ? c->cmd->proc : NULL;

    freeClientArgv(c);
    c->reqtype = 0;
    c->multibulklen = 0;
    c->bulklen = -1;
    /* We clear the ASKING flag as well if we are not inside a MULTI, and
     * if what we just executed is not the ASKING command itself. */
    if (!(c->flags & REDIS_MULTI) && prevcmd != askingCommand)
        c->flags &= (~REDIS_ASKING);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x2cf6f
movq 0x8(%rax), %rax
cmpq 0x95f8f(%rip), %rax     # 0xc2ef8
setne %bpl
jmp 0x2cf72
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x2cea3
andq $0x0, 0x50(%rbx)
orq $-0x1, 0x58(%rbx)
movl 0x90(%rbx), %eax
testb $0x8, %al
jne 0x2cf9e
testb %bpl, %bpl
je 0x2cf9e
andl $0xfffffdf7, %eax       # imm = 0xFFFFFDF7
movl %eax, 0x90(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: setProtocolError
static void setProtocolError(redisClient *c, int pos) {
    if (server.verbosity >= REDIS_VERBOSE) {
        sds client = catClientInfoString(sdsempty(),c);
        redisLog(REDIS_VERBOSE,
            "Protocol error from client: %s", client);
        sdsfree(client);
    }
    c->flags |= REDIS_CLOSE_AFTER_REPLY;
    sdsrange(c->querybuf,pos,-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x99e89(%rip), %rax     # 0xc6fa8
cmpl $0x0, 0x464(%rax)
jle 0x2d157
callq 0x271bf
movq %rax, %rdi
movq %r14, %rsi
callq 0x2d623
movq %rax, %r15
leaq 0x60160(%rip), %rsi     # 0x8d2a2
pushq $0x1
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x22613
movq %r15, %rdi
callq 0x271f7
orb $0x40, 0x90(%r14)
movq 0x20(%r14), %rdi
pushq $-0x1
popq %rdx
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmp 0x27a3e
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: clientsArePaused
int clientsArePaused(void) {
    if (server.clients_paused && server.clients_pause_end_time < server.mstime) {
        listNode *ln;
        listIter li;
        redisClient *c;

        server.clients_paused = 0;

        /* Put all the clients in the unblocked clients queue in order to
         * force the re-processing of the input buffer if any. */
        listRewind(server.clients,&li);
        while ((ln = listNext(&li)) != NULL) {
            c = listNodeValue(ln);

            if (c->flags & REDIS_SLAVE) continue;
            listAddNodeTail(server.unblocked_clients,c);
        }
    }
    return server.clients_paused;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0x999f7(%rip), %r14     # 0xc6fa8
movl 0x1d8(%r14), %eax
testl %eax, %eax
je 0x2d610
movq 0x1e0(%r14), %rcx
cmpq 0x7a0(%r14), %rcx
jge 0x2d61b
andl $0x0, 0x1d8(%r14)
movq 0x1b0(%r14), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x1ffac
movq %rbx, %rdi
callq 0x1ffc6
testq %rax, %rax
je 0x2d614
movq 0x10(%rax), %rsi
testb $0x1, 0x90(%rsi)
jne 0x2d5e8
movq 0x738(%r14), %rdi
callq 0x1fe4c
jmp 0x2d5e8
xorl %eax, %eax
jmp 0x2d61b
movl 0x1d8(%r14), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: genClientPeerId
int genClientPeerId(redisClient *client, char *peerid, size_t peerid_len) {
    char ip[REDIS_IP_STR_LEN];
    int port;

    if (client->flags & REDIS_UNIX_SOCKET) {
        /* Unix socket client. */
        snprintf(peerid,peerid_len,"%s:0",server.unixsocket);
        return REDIS_OK;
    } else {
        /* TCP client. */
        int retval = anetPeerToString(client->fd,ip,sizeof(ip),&port);
        formatPeerId(peerid,peerid_len,ip,port);
        return (retval == -1) ? REDIS_ERR : REDIS_OK;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
testb $0x8, 0x91(%rdi)
jne 0x2d991
movl (%rdi), %edi
leaq 0x10(%rsp), %r15
pushq $0x2e
popq %rdx
leaq 0xc(%rsp), %r12
movq %r15, %rsi
movq %r12, %rcx
callq 0x21481
movl %eax, %r13d
movl (%r12), %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2d8e6
xorl %ebp, %ebp
cmpl $-0x1, %r13d
sete %bpl
negl %ebp
jmp 0x2d9b5
leaq 0x99610(%rip), %rax     # 0xc6fa8
movq 0x118(%rax), %rcx
leaq 0x5f6c0(%rip), %rdx     # 0x8d066
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1f120
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: getClientPeerId
char *getClientPeerId(redisClient *c) {
    char peerid[REDIS_PEER_ID_LEN];

    if (c->peerid == NULL) {
        genClientPeerId(c,peerid,sizeof(peerid));
        c->peerid = sdsnew(peerid);
    }
    return c->peerid;
}

// Assembly:
movq 0x168(%rdi), %rax
testq %rax, %rax
je 0x2d9d3
retq
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq %rsp, %r14
pushq $0x4e
popq %rdx
movq %r14, %rsi
callq 0x2d937
movq %r14, %rdi
callq 0x271cd
movq %rax, 0x168(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: rewriteClientCommandVector
void rewriteClientCommandVector(redisClient *c, int argc, ...) {
    va_list ap;
    int j;
    robj **argv; /* The new argument vector */

    // 创建新参数
    argv = zmalloc(sizeof(robj*)*argc);
    va_start(ap,argc);
    for (j = 0; j < argc; j++) {
        robj *a;
        
        a = va_arg(ap, robj*);
        argv[j] = a;
        incrRefCount(a);
    }
    /* We free the objects in the original vector at the end, so we are
     * sure that if the same objects are reused in the new vector the
     * refcount gets incremented before it gets decremented. */
    // 释放旧参数
    for (j = 0; j < c->argc; j++) decrRefCount(c->argv[j]);
    zfree(c->argv);

    /* Replace argv and argc with our new versions. */
    // 用新参数替换
    c->argv = argv;
    c->argc = argc;
    c->cmd = lookupCommandOrOriginal(c->argv[0]->ptr);
    redisAssertWithInfo(c,NULL,c->cmd != NULL);
    va_end(ap);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x2dd92
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movslq %esi, %r12
leaq (,%r12,8), %rdi
callq 0x2828d
movq %rax, %r14
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x10(%rsp)
xorl %r15d, %r15d
testl %r12d, %r12d
movl $0x0, %r12d
cmovgl %ebp, %r12d
cmpq %r15, %r12
je 0x2de12
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x2ddf3
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x2de01
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rdi
movq %rdi, (%r14,%r15,8)
callq 0x2eacc
incq %r15
jmp 0x2ddd5
xorl %r15d, %r15d
movslq 0x30(%rbx), %rax
movq 0x38(%rbx), %rdi
cmpq %rax, %r15
jge 0x2de30
movq (%rdi,%r15,8), %rdi
callq 0x2ee1f
incq %r15
jmp 0x2de15
callq 0x283cd
movq %r14, 0x38(%rbx)
movl %ebp, 0x30(%rbx)
movq (%r14), %rax
movq 0x8(%rax), %rdi
callq 0x24bdb
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x2de61
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5f346(%rip), %rdx     # 0x8d1ae
leaq 0x5eeff(%rip), %rcx     # 0x8cd6e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x768, %r8d            # imm = 0x768
callq 0x4980c
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: rewriteClientCommandArgument
void rewriteClientCommandArgument(redisClient *c, int i, robj *newval) {
    robj *oldval;
   
    redisAssertWithInfo(c,NULL,i < c->argc);
    oldval = c->argv[i];
    c->argv[i] = newval;
    incrRefCount(newval);
    decrRefCount(oldval);

    /* If this is the command name make sure to fix c->cmd. */
    if (i == 0) {
        c->cmd = lookupCommandOrOriginal(c->argv[0]->ptr);
        redisAssertWithInfo(c,NULL,c->cmd != NULL);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x30(%rdi)
jle 0x2ded7
movq 0x38(%rbx), %rax
movslq %esi, %r15
movq (%rax,%r15,8), %r14
movq %rdx, (%rax,%r15,8)
movq %rdx, %rdi
callq 0x2eacc
movq %r14, %rdi
callq 0x2ee1f
testl %r15d, %r15d
jne 0x2ded1
movq 0x38(%rbx), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
callq 0x24bdb
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x2def2
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5f2df(%rip), %rdx     # 0x8d1bd
leaq 0x5ee89(%rip), %rcx     # 0x8cd6e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x772, %r8d            # imm = 0x772
jmp 0x2df0b
leaq 0x5f2b5(%rip), %rdx     # 0x8d1ae
leaq 0x5ee6e(%rip), %rcx     # 0x8cd6e
movq %rbx, %rdi
xorl %esi, %esi
movl $0x77b, %r8d            # imm = 0x77B
callq 0x4980c
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: getClientLimitClassByName
int getClientLimitClassByName(char *name) {
    if (!strcasecmp(name,"normal")) return REDIS_CLIENT_LIMIT_CLASS_NORMAL;
    else if (!strcasecmp(name,"slave")) return REDIS_CLIENT_LIMIT_CLASS_SLAVE;
    else if (!strcasecmp(name,"pubsub")) return REDIS_CLIENT_LIMIT_CLASS_PUBSUB;
    else return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x5f270(%rip), %rsi     # 0x8d1c9
callq 0x1f2e0
testl %eax, %eax
je 0x2df91
leaq 0x64ed1(%rip), %rsi     # 0x92e3a
movq %rbx, %rdi
callq 0x1f2e0
testl %eax, %eax
je 0x2df95
leaq 0x5c656(%rip), %rsi     # 0x8a5d2
movq %rbx, %rdi
callq 0x1f2e0
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
orl $0x2, %eax
jmp 0x2df98
xorl %eax, %eax
jmp 0x2df98
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: flushSlavesOutputBuffers
void flushSlavesOutputBuffers(void) {
    listIter li;
    listNode *ln;

    listRewind(server.slaves,&li);
    while((ln = listNext(&li))) {
        redisClient *slave = listNodeValue(ln);
        int events;

        events = aeGetFileEvents(server.el,slave->fd);
        if (events & AE_WRITABLE &&
            slave->replstate == REDIS_REPL_ONLINE &&
            listLength(slave->reply))
        {
            sendReplyToClient(server.el,slave->fd,slave,0);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x98f55(%rip), %r15     # 0xc6fa8
movq 0x1c0(%r15), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x1ffac
movq %rbx, %rdi
callq 0x1ffc6
testq %rax, %rax
je 0x2e0a8
movq 0x10(%rax), %r14
movq 0x28(%r15), %rdi
movl (%r14), %esi
callq 0x20487
testb $0x2, %al
je 0x2e065
cmpl $0x9, 0x98(%r14)
jne 0x2e065
movq 0x60(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0x2e065
movl (%r14), %esi
movq %r14, %rdx
callq 0x2bb9f
jmp 0x2e065
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: processEventsWhileBlocked
int processEventsWhileBlocked(void) {
    int iterations = 4; /* See the function top-comment. */
    int count = 0;
    while (iterations--) {
        int events = aeProcessEvents(server.el, AE_FILE_EVENTS|AE_DONT_WAIT);
        if (!events) break;
        count += events;
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
pushq $-0x5
popq %r14
leaq 0x98ee2(%rip), %r15     # 0xc6fa8
pushq $0x5
popq %rbp
incl %r14d
je 0x2e0df
movq 0x28(%r15), %rdi
movl %ebp, %esi
callq 0x205dc
addl %eax, %ebx
testl %eax, %eax
jne 0x2e0c9
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/util.c
// Function: ll2string
int ll2string(char *s, size_t len, long long value) {
    char buf[32], *p;
    unsigned long long v;
    size_t l;

    if (len == 0) return 0;
    v = (value < 0) ? -value : value;
    p = buf+31; /* point to the last character */
    do {
        *p-- = '0'+(v%10);
        v /= 10;
    } while(v);
    if (value < 0) *p-- = '-';
    p++;
    l = 32-(p-buf);
    if (l+1 > len) l = len-1; /* Make sure it fits, including the nul term */
    memcpy(s,p,l);
    s[l] = '\0';
    return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
testq %rsi, %rsi
je 0x2e55b
movq %rdx, %rcx
movq %rdi, %rbx
movq %rdx, %rdi
negq %rdi
cmovsq %rdx, %rdi
xorl %r8d, %r8d
pushq $0xa
popq %r9
movq %rdi, %rax
xorl %edx, %edx
divq %r9
orb $0x30, %dl
movb %dl, 0x1f(%rsp,%r8)
decq %r8
cmpq $0x9, %rdi
movq %rax, %rdi
ja 0x2e536
testq %rcx, %rcx
js 0x2e560
pushq $-0x1
jmp 0x2e568
xorl %r14d, %r14d
jmp 0x2e597
movb $0x2d, 0x1f(%rsp,%r8)
pushq $-0x2
popq %r15
addq %r8, %r15
leaq (%rsp,%r15), %rax
addq $0x21, %rax
negq %r15
cmpq %rsi, %r15
cmovaq %rsi, %r15
leaq -0x1(%r15), %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x1fbd0
movb $0x0, -0x1(%rbx,%r15)
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/util.c
// Function: getRandomHexChars
void getRandomHexChars(char *p, unsigned int len) {
    FILE *fp = fopen("/dev/urandom","r");
    char *charset = "0123456789abcdef";
    unsigned int j;

    if (fp == NULL || fread(p,len,1,fp) == 0) {
        /* If we can't read from /dev/urandom, do some reasonable effort
         * in order to create some entropy, since this function is used to
         * generate run_id and cluster instance IDs */
        char *x = p;
        unsigned int l = len;
        struct timeval tv;
        pid_t pid = getpid();

        /* Use time and PID to fill the initial array. */
        gettimeofday(&tv,NULL);
        if (l >= sizeof(tv.tv_usec)) {
            memcpy(x,&tv.tv_usec,sizeof(tv.tv_usec));
            l -= sizeof(tv.tv_usec);
            x += sizeof(tv.tv_usec);
        }
        if (l >= sizeof(tv.tv_sec)) {
            memcpy(x,&tv.tv_sec,sizeof(tv.tv_sec));
            l -= sizeof(tv.tv_sec);
            x += sizeof(tv.tv_sec);
        }
        if (l >= sizeof(pid)) {
            memcpy(x,&pid,sizeof(pid));
            l -= sizeof(pid);
            x += sizeof(pid);
        }
        /* Finally xor it with rand() output, that was already seeded with
         * time() at startup. */
        for (j = 0; j < len; j++)
            p[j] ^= rand();
    }
    /* Turn it into hex digits taking just 4 bits out of 8 for every byte. */
    for (j = 0; j < len; j++)
        p[j] = charset[p[j] & 0x0F];
    if (fp) fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x5eb40(%rip), %rdi     # 0x8d2ef
leaq 0x5e41d(%rip), %rsi     # 0x8cbd3
callq 0x1fa60
movq %rax, %r14
movl %r12d, %r15d
testq %rax, %rax
je 0x2e815
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x1f7c0
testq %rax, %rax
je 0x2e815
xorl %eax, %eax
leaq 0x5eb17(%rip), %rcx     # 0x8d2fc
cmpq %rax, %r15
je 0x2e7fc
movzbl (%rbx,%rax), %edx
andl $0xf, %edx
movb (%rdx,%rcx), %dl
movb %dl, (%rbx,%rax)
incq %rax
jmp 0x2e7e5
testq %r14, %r14
je 0x2e850
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1f9a0
callq 0x1f410
movl %eax, %ebp
movq %rsp, %rdi
xorl %esi, %esi
callq 0x1f2f0
cmpl $0x8, %r12d
jb 0x2e85d
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
leal -0x8(%r12), %ecx
cmpl $0x8, %ecx
jb 0x2e865
movq (%rsp), %rax
movq %rax, 0x8(%rbx)
addl $-0x10, %r12d
leaq 0x10(%rbx), %rax
jmp 0x2e860
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rax
movl %r12d, %ecx
jmp 0x2e869
leaq 0x8(%rbx), %rax
cmpl $0x4, %ecx
jb 0x2e870
movl %ebp, (%rax)
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x2e7dc
callq 0x1faf0
xorb %al, (%rbx,%r12)
incq %r12
jmp 0x2e873
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createEmbeddedStringObject
robj *createEmbeddedStringObject(char *ptr, size_t len) {
    robj *o = zmalloc(sizeof(robj)+sizeof(struct sdshdr)+len+1);
    struct sdshdr *sh = (void*)(o+1);

    o->type = REDIS_STRING;
    o->encoding = REDIS_ENCODING_EMBSTR;
    o->ptr = sh+1;
    o->refcount = 1;
    o->lru = LRU_CLOCK();

    sh->len = len;
    sh->free = 0;
    if (ptr) {
        memcpy(sh->buf,ptr,len);
        sh->buf[len] = '\0';
    } else {
        memset(sh->buf,0,len+1);
    }
    return o;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x19(%rsi), %rdi
callq 0x2828d
movq %rax, %r14
movb $-0x80, (%rax)
leaq 0x18(%rax), %r12
movq %r12, 0x8(%rax)
movl $0x1, 0x4(%rax)
leaq 0x98577(%rip), %rax     # 0xc6fa8
movl 0x30(%rax), %eax
shll $0x8, %eax
orl $0x80, %eax
movl %eax, (%r14)
movl %ebx, 0x10(%r14)
andl $0x0, 0x14(%r14)
testq %r15, %r15
je 0x2ea62
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1fbd0
movb $0x0, (%r12,%rbx)
jmp 0x2ea72
incq %rbx
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1f110
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl (%rdi), %eax
testb $0xf, %al
jne 0x2eb9b
movq %rdi, %rbx
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x2eb8d
cmpl $0x1, %eax
je 0x2eb6e
testl %eax, %eax
jne 0x2ebb5
movq 0x8(%rbx), %rdi
movslq -0x8(%rdi), %rsi
popq %rbx
jmp 0x2e9ed
xorl %edi, %edi
xorl %esi, %esi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x10, %ecx
movl %ecx, (%rax)
movq 0x8(%rbx), %rcx
movq %rcx, 0x8(%rax)
popq %rbx
retq
movq 0x8(%rbx), %rdi
movslq -0x8(%rdi), %rsi
popq %rbx
jmp 0x2e9fe
leaq 0x5e1b4(%rip), %rdi     # 0x8cd56
leaq 0x5e7aa(%rip), %rsi     # 0x8d353
movl $0xc0, %edx
callq 0x4906b
jmp 0x2ebcd
leaq 0x5e7a0(%rip), %rdi     # 0x8d35c
leaq 0x5e790(%rip), %rsi     # 0x8d353
movl $0xd1, %edx
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
callq 0x1fd8c
movq %rax, %rbx
pushq $0x1
popq %rdi
movq %rax, %rsi
callq 0x2e9b4
leaq 0x12(%rip), %rcx        # 0x2ec02
movq %rcx, 0x18(%rbx)
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x40, %ecx
movl %ecx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rax
callq 0x2a868
pushq $0x1
popq %rdi
movq %rax, %rsi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x50, %ecx
movl %ecx, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rax
leaq 0x97c42(%rip), %rdi     # 0xc6870
xorl %esi, %esi
callq 0x216f0
pushq $0x2
popq %rdi
movq %rax, %rsi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x20, %ecx
movl %ecx, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rax
callq 0x4b294
pushq $0x2
popq %rdi
movq %rax, %rsi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x60, %ecx
movl %ecx, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createHashObject
robj *createHashObject(void) {

    unsigned char *zl = ziplistNew();

    robj *o = createObject(REDIS_HASH, zl);

    o->encoding = REDIS_ENCODING_ZIPLIST;

    return o;
}

// Assembly:
pushq %rax
callq 0x2a868
pushq $0x4
popq %rdi
movq %rax, %rsi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x50, %ecx
movl %ecx, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq $0x10
popq %rdi
callq 0x2828d
movq %rax, %rbx
leaq 0x97c01(%rip), %rdi     # 0xc68a0
xorl %esi, %esi
callq 0x216f0
movq %rax, (%rbx)
callq 0x3a4ba
movq %rax, 0x8(%rbx)
pushq $0x3
popq %rdi
movq %rbx, %rsi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x70, %ecx
movl %ecx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/object.c
// Function: createZsetZiplistObject
robj *createZsetZiplistObject(void) {

    unsigned char *zl = ziplistNew();

    robj *o = createObject(REDIS_ZSET,zl);

    o->encoding = REDIS_ENCODING_ZIPLIST;

    return o;
}

// Assembly:
pushq %rax
callq 0x2a868
pushq $0x3
popq %rdi
movq %rax, %rsi
callq 0x2e9b4
movl $0xffffff0f, %ecx       # imm = 0xFFFFFF0F
andl (%rax), %ecx
orl $0x50, %ecx
movl %ecx, (%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
je 0x2ed14
cmpl $0x4, %eax
jne 0x2ed1d
movq 0x8(%rdi), %rdi
jmp 0x1fdaa
movq 0x8(%rdi), %rdi
jmp 0x283cd
pushq %rax
leaq 0x5e649(%rip), %rdi     # 0x8d36e
leaq 0x5e627(%rip), %rsi     # 0x8d353
movl $0x158, %edx            # imm = 0x158
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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:
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x6, %eax
je 0x2ed59
cmpl $0x2, %eax
jne 0x2ed62
movq 0x8(%rdi), %rdi
jmp 0x21e31
movq 0x8(%rdi), %rdi
jmp 0x283cd
pushq %rax
leaq 0x5e621(%rip), %rdi     # 0x8d38b
leaq 0x5e5e2(%rip), %rsi     # 0x8d353
movl $0x16c, %edx            # imm = 0x16C
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
je 0x2edb0
cmpl $0x7, %eax
jne 0x2edba
movq 0x8(%rdi), %rbx
movq (%rbx), %rdi
callq 0x21e31
movq 0x8(%rbx), %rdi
callq 0x3a525
movq %rbx, %rdi
jmp 0x2edb4
movq 0x8(%rdi), %rdi
popq %rbx
jmp 0x283cd
leaq 0x5e5e6(%rip), %rdi     # 0x8d3a7
leaq 0x5e58b(%rip), %rsi     # 0x8d353
movl $0x185, %edx            # imm = 0x185
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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:
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
je 0x2edf5
cmpl $0x2, %eax
jne 0x2edfe
movq 0x8(%rdi), %rdi
jmp 0x21e31
movq 0x8(%rdi), %rdi
jmp 0x283cd
pushq %rax
leaq 0x5e5bf(%rip), %rdi     # 0x8d3c5
leaq 0x5e546(%rip), %rsi     # 0x8d353
movl $0x199, %edx            # imm = 0x199
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl 0x4(%rdi), %eax
testl %eax, %eax
jle 0x2ee89
movq %rdi, %rbx
cmpl $0x1, %eax
jne 0x2ee53
movl (%rbx), %eax
andl $0xf, %eax
cmpl $0x4, %eax
ja 0x2eea9
leaq 0x5e4d4(%rip), %rcx     # 0x8d314
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2ecea
jmp 0x2ee80
decl %eax
movl %eax, 0x4(%rbx)
popq %rbx
retq
movq %rbx, %rdi
callq 0x2edda
jmp 0x2ee80
movq %rbx, %rdi
callq 0x2ed3e
jmp 0x2ee80
movq %rbx, %rdi
callq 0x2ed83
jmp 0x2ee80
movq %rbx, %rdi
callq 0x2ecf9
movq %rbx, %rdi
popq %rbx
jmp 0x283cd
leaq 0x5e552(%rip), %rdi     # 0x8d3e2
leaq 0x5e4bc(%rip), %rsi     # 0x8d353
movl $0x1ac, %edx            # imm = 0x1AC
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
leaq 0x5e557(%rip), %rdi     # 0x8d407
leaq 0x5e49c(%rip), %rsi     # 0x8d353
movl $0x1b6, %edx            # imm = 0x1B6
jmp 0x2ee9c
// File: /workspace/github_c_makefile_star2_O2/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 %rax
movq %rsi, %rdx
movq %rdi, %rsi
movl (%rdi), %eax
testb $0xf, %al
jne 0x2ef29
andl $0xf0, %eax
cmpl $0x10, %eax
jne 0x2ef11
xorl %eax, %eax
testq %rdx, %rdx
je 0x2ef27
movq 0x8(%rsi), %rcx
movq %rcx, (%rdx)
jmp 0x2ef27
movq 0x8(%rsi), %rdi
movslq -0x8(%rdi), %rsi
callq 0x2e5a4
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
sbbl %eax, %eax
popq %rcx
retq
leaq 0x5de26(%rip), %rdx     # 0x8cd56
leaq 0x5e41c(%rip), %rcx     # 0x8d353
xorl %edi, %edi
movl $0x1fd, %r8d            # imm = 0x1FD
callq 0x4980c
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x20, %rsp
movq %rdi, %rax
movl (%rdi), %edx
movl %edx, %ecx
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x2f0a0
incl 0x4(%rax)
jmp 0x2f0d2
testb $0xf, %dl
jne 0x2f0d8
andl $0xf, %ecx
cmpl $0x1, %ecx
jne 0x2f0d8
movq 0x8(%rax), %rdx
movq %rsp, %rbx
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x2e511
movq %rbx, %rdi
callq 0x1f4f0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2ea81
addq $0x20, %rsp
popq %rbx
retq
leaq 0x5e33e(%rip), %rdi     # 0x8d41d
leaq 0x5e26d(%rip), %rsi     # 0x8d353
movl $0x27a, %edx            # imm = 0x27A
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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:
movl $0xf0, %eax
movl (%rdi), %ecx
andl %eax, %ecx
cmpl $0x10, %ecx
jne 0x2f214
andl (%rsi), %eax
cmpl $0x10, %eax
jne 0x2f214
movq 0x8(%rdi), %rax
cmpq 0x8(%rsi), %rax
sete %al
jmp 0x2f223
pushq %rax
callq 0x2f1e2
testl %eax, %eax
sete %al
addq $0x8, %rsp
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
subq $0x28, %rsp
movq %rdi, %rsi
movl (%rdi), %eax
testb $0xf, %al
jne 0x2f25a
shrl $0x4, %eax
testb $0x7, %al
jne 0x2f244
movq 0x8(%rsi), %rax
movl -0x8(%rax), %eax
jmp 0x2f253
movq 0x8(%rsi), %rdx
movq %rsp, %rdi
pushq $0x20
popq %rsi
callq 0x2e511
cltq
addq $0x28, %rsp
retq
leaq 0x5daf5(%rip), %rdx     # 0x8cd56
leaq 0x5e0eb(%rip), %rcx     # 0x8d353
xorl %edi, %edi
movl $0x2e5, %r8d            # imm = 0x2E5
callq 0x4980c
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/src/object.c
// Function: getDoubleFromObject
int getDoubleFromObject(robj *o, double *target) {
    double value;
    char *eptr;

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

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

        // 尝试从字符串中转换 double 值
        if (sdsEncodedObject(o)) {
            errno = 0;
            value = strtod(o->ptr, &eptr);
            if (isspace(((char*)o->ptr)[0]) ||
                eptr[0] != '\0' ||
                (errno == ERANGE &&
                    (value == HUGE_VAL || value == -HUGE_VAL || value == 0)) ||
                errno == EINVAL ||
                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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
testq %rdi, %rdi
je 0x2f33d
movq %rdi, %r14
movl (%rdi), %eax
testb $0xf, %al
jne 0x2f359
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x2f2bb
cmpl $0x1, %eax
je 0x2f343
testl %eax, %eax
jne 0x2f379
callq 0x1f810
movq %rax, %r15
andl $0x0, (%rax)
movq 0x8(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1fc40
movsd %xmm0, (%rsp)
callq 0x1f550
movq (%rax), %rcx
movq 0x8(%r14), %rax
movsbq (%rax), %rdx
pushq $-0x1
popq %rax
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x2f34f
movq 0x8(%rsp), %rcx
cmpb $0x0, (%rcx)
jne 0x2f34f
movl (%r15), %ecx
cmpl $0x22, %ecx
movq (%rsp), %xmm0
jne 0x2f330
movq %xmm0, %rdx
btrq $0x3f, %rdx
movabsq $0x7ff0000000000000, %rsi # imm = 0x7FF0000000000000
cmpq %rsi, %rdx
sete %sil
testq %rdx, %rdx
sete %dl
orb %sil, %dl
jne 0x2f34f
cmpl $0x16, %ecx
je 0x2f34f
ucomisd %xmm0, %xmm0
jnp 0x2f349
jmp 0x2f34f
xorpd %xmm0, %xmm0
jmp 0x2f349
cvtsi2sdq 0x8(%r14), %xmm0
movsd %xmm0, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5d9f6(%rip), %rdx     # 0x8cd56
leaq 0x5dfec(%rip), %rcx     # 0x8d353
xorl %edi, %edi
movq %r14, %rsi
movl $0x301, %r8d            # imm = 0x301
callq 0x4980c
jmp 0x2f391
leaq 0x5e0e8(%rip), %rdi     # 0x8d468
leaq 0x5dfcc(%rip), %rsi     # 0x8d353
movl $0x314, %edx            # imm = 0x314
callq 0x490e8
pushq $0x1
popq %rdi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2f27d
testl %eax, %eax
je 0x2f3cc
testq %rbx, %rbx
je 0x2f3db
movq %r14, %rdi
movq %rbx, %rsi
jmp 0x2f3e5
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r15)
xorl %eax, %eax
jmp 0x2f3ed
leaq 0x602bb(%rip), %rsi     # 0x8f69d
movq %r14, %rdi
callq 0x2c2da
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq