LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/zipmap.c
// Function: zipmapNext
unsigned char *zipmapNext(unsigned char *zm, unsigned char **key, unsigned int *klen, unsigned char **value, unsigned int *vlen) {

    // 已到达列表末尾，停止迭代
    if (zm[0] == ZIPMAP_END) return NULL;

    // 取出键，并保存到 key 参数中
    if (key) {
        *key = zm;
        *klen = zipmapDecodeLength(zm);
        *key += ZIPMAP_LEN_BYTES(*klen);
    }
    // 越过键
    zm += zipmapRawKeyLength(zm);

    // 取出值，并保存到 value 参数中
    if (value) {
        *value = zm+1;
        *vlen = zipmapDecodeLength(zm);
        *value += ZIPMAP_LEN_BYTES(*vlen);
    }
    // 越过值
    zm += zipmapRawValueLength(zm);

    // 返回指向下一节点的指针
    return zm;
}

// Assembly:
cmpb $-0x1, (%rdi)
je 0x2a804
testq %rsi, %rsi
je 0x2a78b
movq %rdi, (%rsi)
movzbl (%rdi), %eax
cmpl $0xfd, %eax
jbe 0x2a775
movl 0x1(%rdi), %eax
movl %eax, (%rdx)
xorl %edx, %edx
cmpl $0xfe, %eax
setae %dl
leaq (%rdi,%rdx,4), %rax
incq %rax
movq %rax, (%rsi)
movzbl (%rdi), %eax
cmpl $0xfd, %eax
jbe 0x2a798
movl 0x1(%rdi), %eax
xorl %edx, %edx
cmpl $0xfe, %eax
setae %dl
leal (%rax,%rdx,4), %eax
incl %eax
addq %rax, %rdi
testq %rcx, %rcx
je 0x2a7dc
leaq 0x1(%rdi), %rax
movq %rax, (%rcx)
movzbl (%rdi), %edx
cmpl $0xfd, %edx
jbe 0x2a7c3
movl (%rax), %edx
movl %edx, (%r8)
xorl %esi, %esi
cmpl $0xfe, %edx
setae %sil
leaq (%rax,%rsi,4), %rax
incq %rax
movq %rax, (%rcx)
movzbl (%rdi), %eax
cmpl $0xfd, %eax
jbe 0x2a7e9
movl 0x1(%rdi), %eax
xorl %ecx, %ecx
cmpl $0xfe, %eax
setae %cl
movzbl 0x1(%rdi,%rcx,4), %edx
addl %eax, %edx
leal (%rdx,%rcx,4), %eax
addl $0x2, %eax
addq %rdi, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/zipmap.c
// Function: zipmapGet
int zipmapGet(unsigned char *zm, unsigned char *key, unsigned int klen, unsigned char **value, unsigned int *vlen) {
    unsigned char *p;

    // 在 zipmap 中按 key 查找
    // 没找到直接返回 0 
    // T = O(N^2)
    if ((p = zipmapLookupRaw(zm,key,klen,NULL)) == NULL) return 0;

    // 越过键，指向值
    p += zipmapRawKeyLength(p);
    // 取出值的长度
    *vlen = zipmapDecodeLength(p);
    // 将 *value 指向值， +1 为越过 <free> 属性
    *value = p + ZIPMAP_LEN_BYTES(*vlen) + 1;

    // 找到，返回 1 
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r8, %r14
movq %rcx, %rbx
xorl %r15d, %r15d
xorl %ecx, %ecx
callq 0x2a563
testq %rax, %rax
je 0x2a874
movq %rax, %rcx
movzbl (%rax), %edx
cmpl $0xfd, %edx
jbe 0x2a832
movl 0x1(%rcx), %edx
xorl %esi, %esi
cmpl $0xfe, %edx
setae %sil
leal (%rdx,%rsi,4), %edx
incl %edx
addq %rdx, %rax
movzbl (%rcx,%rdx), %ecx
cmpl $0xfd, %ecx
jbe 0x2a855
movl 0x1(%rax), %ecx
movl %ecx, (%r14)
xorl %edx, %edx
cmpl $0xfe, %ecx
setae %dl
leaq (%rax,%rdx,4), %rax
addq $0x2, %rax
movq %rax, (%rbx)
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/zipmap.c
// Function: zipmapLen
unsigned int zipmapLen(unsigned char *zm) {

    unsigned int len = 0;

    if (zm[0] < ZIPMAP_BIGLEN) {
        // 长度可以用 1 字节保存
        // T = O(1)
        len = zm[0];
    } else {
        // 长度不能用 1 字节保存，需要遍历整个 zipmap
        // T = O(N)
        unsigned char *p = zipmapRewind(zm);
        while((p = zipmapNext(p,NULL,NULL,NULL,NULL)) != NULL) len++;

        /* Re-store length if small enough */
        // 如果字节数量已经少于 ZIPMAP_BIGLEN ，那么重新将值保存到 len 中
        // 这种情况在节点数超过 ZIPMAP_BIGLEN 之后，有节点被删除时会出现
        if (len < ZIPMAP_BIGLEN) zm[0] = len;
    }

    return len;
}

// Assembly:
movzbl (%rdi), %eax
cmpl $0xfd, %eax
jbe 0x2a911
leaq 0x1(%rdi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movzbl (%rcx), %edx
cmpl $0xfe, %edx
je 0x2a8bb
cmpl $0xff, %edx
jne 0x2a8be
xorl %ecx, %ecx
jmp 0x2a901
movl 0x1(%rcx), %edx
xorl %esi, %esi
cmpl $0xfe, %edx
setae %sil
leal (%rdx,%rsi,4), %esi
incl %esi
leaq (%rcx,%rsi), %rdx
movzbl (%rcx,%rsi), %ecx
cmpl $0xfd, %ecx
jbe 0x2a8e2
movl 0x1(%rdx), %ecx
xorl %esi, %esi
cmpl $0xfe, %ecx
setae %sil
movzbl 0x1(%rdx,%rsi,4), %r8d
addl %ecx, %r8d
leal (%r8,%rsi,4), %ecx
addl $0x2, %ecx
addq %rdx, %rcx
incl %eax
testq %rcx, %rcx
jne 0x2a8a4
cmpl $0xfd, %eax
ja 0x2a911
movb %al, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/sha1.c
// Function: SHA1Update
void SHA1Update(SHA1_CTX* context, const unsigned char* data, u_int32_t len)
{
    u_int32_t i, j;

    j = context->count[0];
    if ((context->count[0] += len << 3) < j)
        context->count[1]++;
    context->count[1] += (len>>29);
    j = (j >> 3) & 63;
    if ((j + len) > 63) {
        memcpy(&context->buffer[j], data, (i = 64-j));
        SHA1Transform(context->state, context->buffer);
        for ( ; i + 63 < len; i += 64) {
            SHA1Transform(context->state, &data[i]);
        }
        j = 0;
    }
    else i = 0;
    memcpy(&context->buffer[j], &data[i], len - i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl 0x14(%rdi), %ebp
leal (,%rbx,8), %eax
addl %ebp, %eax
movl %eax, 0x14(%rdi)
jae 0x2ba60
incl 0x18(%r15)
movl %ebx, %eax
shrl $0x1d, %eax
addl %eax, 0x18(%r15)
shrl $0x3, %ebp
andl $0x3f, %ebp
leal (%rbx,%rbp), %eax
cmpl $0x40, %eax
jb 0x2bac8
leaq 0x1c(%r15), %r13
leaq (%r15,%rbp), %rdi
addq $0x1c, %rdi
movl $0x40, %r12d
subl %ebp, %r12d
movq %r14, %rsi
movq %r12, %rdx
callq 0x1fbd0
movq %r15, %rdi
movq %r13, %rsi
callq 0x2a930
xorl $0x7f, %ebp
cmpl %ebx, %ebp
jae 0x2bacf
leal -0x3f(%rbp), %esi
addq %r14, %rsi
movq %r15, %rdi
callq 0x2a930
addl $0x40, %ebp
cmpl %ebx, %ebp
jb 0x2baa9
addl $-0x3f, %ebp
xorl %eax, %eax
movl %ebp, %r12d
jmp 0x2bad1
movl %ebp, %eax
xorl %r12d, %r12d
jmp 0x2bad1
xorl %eax, %eax
leaq (%r15,%rax), %rdi
addq $0x1c, %rdi
movl %r12d, %eax
addq %rax, %r14
subl %r12d, %ebx
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1fbd0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistPush
unsigned char *ziplistPush(unsigned char *zl, unsigned char *s, unsigned int slen, int where) {

    // 根据 where 参数的值，决定将值推入到表头还是表尾
    unsigned char *p;
    p = (where == ZIPLIST_HEAD) ? ZIPLIST_ENTRY_HEAD(zl) : ZIPLIST_ENTRY_END(zl);

    // 返回添加新值后的 ziplist
    // T = O(N^2)
    return __ziplistInsert(zl,p,s,slen);
}

// Assembly:
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, %rdx
testl %eax, %eax
je 0x2bc1a
movl (%rdi), %eax
leaq (%rdi,%rax), %rsi
decq %rsi
jmp 0x2bc20
leaq 0xa(%rdi), %rsi
jmp 0x2bc20
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistIndex
unsigned char *ziplistIndex(unsigned char *zl, int index) {

    unsigned char *p;

    zlentry entry;

    // 处理负数索引
    if (index < 0) {

        // 将索引转换为正数
        index = (-index)-1;
        
        // 定位到表尾节点
        p = ZIPLIST_ENTRY_TAIL(zl);

        // 如果列表不为空，那么。。。
        if (p[0] != ZIP_END) {

            // 从表尾向表头遍历
            entry = zipEntry(p);
            // T = O(N)
            while (entry.prevrawlen > 0 && index--) {
                // 前移指针
                p -= entry.prevrawlen;
                // T = O(1)
                entry = zipEntry(p);
            }
        }

    // 处理正数索引
    } else {

        // 定位到表头节点
        p = ZIPLIST_ENTRY_HEAD(zl);

        // T = O(N)
        while (p[0] != ZIP_END && index--) {
            // 后移指针
            // T = O(1)
            p += zipRawEntryLength(p);
        }
    }

    // 返回结果
    return (p[0] == ZIP_END || index > 0) ? NULL : p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
testl %esi, %esi
js 0x2c02d
leaq 0xa(%rdi), %r15
cmpb $-0x1, 0xa(%rdi)
je 0x2c079
subl $0x1, %ebx
jb 0x2c074
movq %r15, %rdi
callq 0x2c1c5
movl %eax, %eax
leaq (%r15,%rax), %r14
cmpb $-0x1, (%r15,%rax)
movq %r14, %r15
jne 0x2c00e
jmp 0x2c07c
notl %ebx
movl 0x4(%rdi), %eax
leaq (%rdi,%rax), %r14
cmpb $-0x1, (%rdi,%rax)
je 0x2c07c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2c0a0
movl 0x4(%r15), %eax
testl %eax, %eax
je 0x2c07c
movq %rsp, %r15
subl $0x1, %ebx
jb 0x2c099
movl %eax, %eax
subq %rax, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x2c0a0
movl 0x4(%rsp), %eax
testl %eax, %eax
jne 0x2c055
jmp 0x2c07c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %r15, %r14
xorl %ecx, %ecx
testl %ebx, %ebx
movq %r14, %rax
cmovgq %rcx, %rax
cmpb $-0x1, (%r14)
cmoveq %rcx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x2c07c
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: zipEntry
static zlentry zipEntry(unsigned char *p) {
    zlentry e;

    // e.prevrawlensize 保存着编码前一个节点的长度所需的字节数
    // e.prevrawlen 保存着前一个节点的长度
    // T = O(1)
    ZIP_DECODE_PREVLEN(p, e.prevrawlensize, e.prevrawlen);

    // p + e.prevrawlensize 将指针移动到列表节点本身
    // e.encoding 保存着节点值的编码类型
    // e.lensize 保存着编码节点值长度所需的字节数
    // e.len 保存着节点值的长度
    // T = O(1)
    ZIP_DECODE_LENGTH(p + e.prevrawlensize, e.encoding, e.lensize, e.len);

    // 计算头结点的字节数
    e.headersize = e.prevrawlensize + e.lensize;

    // 记录指针
    e.p = p;

    return e;
}

// Assembly:
movzbl (%rsi), %ecx
xorl %eax, %eax
cmpl $0xfe, %ecx
setae %al
leal 0x1(,%rax,4), %eax
movl %eax, (%rdi)
jb 0x2c0bc
movl 0x1(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl %eax, %edx
movzbl (%rsi,%rdx), %ecx
movl %ecx, %r8d
andb $-0x40, %r8b
movzbl %r8b, %r8d
cmpl $0xc0, %ecx
cmovael %ecx, %r8d
movb %r8b, 0x14(%rdi)
jae 0x2c10c
cmpb $-0x80, %r8b
je 0x2c16b
movzbl %r8b, %r8d
cmpl $0x40, %r8d
je 0x2c155
testl %r8d, %r8d
jne 0x2c1a2
movl $0x1, 0x8(%rdi)
andl $0x3f, %ecx
jmp 0x2c191
movl $0x1, 0x8(%rdi)
movzbl %r8b, %edx
cmpl $0xdf, %edx
jle 0x2c13e
cmpl $0xe0, %edx
je 0x2c17a
cmpl $0xf0, %edx
je 0x2c181
movl $0x1, %ecx
cmpl $0xfe, %edx
je 0x2c191
jmp 0x2c18f
cmpl $0xc0, %edx
je 0x2c188
cmpl $0xd0, %edx
jne 0x2c18f
movl $0x4, %ecx
jmp 0x2c191
movl $0x2, 0x8(%rdi)
andl $0x3f, %ecx
shll $0x8, %ecx
movzbl 0x1(%rsi,%rdx), %edx
orl %edx, %ecx
jmp 0x2c191
movl $0x5, 0x8(%rdi)
movl 0x1(%rsi,%rdx), %ecx
bswapl %ecx
jmp 0x2c191
movl $0x8, %ecx
jmp 0x2c191
movl $0x3, %ecx
jmp 0x2c191
movl $0x2, %ecx
jmp 0x2c191
xorl %ecx, %ecx
movl %ecx, 0xc(%rdi)
addl 0x8(%rdi), %eax
movl %eax, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
movq %rdi, %rax
retq
pushq %rax
leaq 0x6d109(%rip), %rdi     # 0x992b3
leaq 0x6aaa4(%rip), %rsi     # 0x96c55
movl $0x2e9, %edx            # imm = 0x2E9
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: zipRawEntryLength
static unsigned int zipRawEntryLength(unsigned char *p) {
    unsigned int prevlensize, encoding, lensize, len;

    // 取出编码前置节点的长度所需的字节数
    // T = O(1)
    ZIP_DECODE_PREVLENSIZE(p, prevlensize);

    // 取出当前节点值的编码类型，编码节点值长度所需的字节数，以及节点值的长度
    // T = O(1)
    ZIP_DECODE_LENGTH(p + prevlensize, encoding, lensize, len);

    // 计算节点占用的字节数总和
    return prevlensize + lensize + len;
}

// Assembly:
xorl %eax, %eax
cmpb $-0x2, (%rdi)
setae %al
leal 0x1(,%rax,4), %eax
movzbl (%rdi,%rax), %ecx
movl %ecx, %edx
andl $-0x40, %edx
cmpl $0xc0, %ecx
cmovael %ecx, %edx
cmpl $0xbf, %edx
ja 0x2c20d
cmpb $-0x80, %dl
je 0x2c267
movzbl %dl, %edx
cmpl $0x40, %edx
je 0x2c253
testl %edx, %edx
jne 0x2c290
andl $0x3f, %ecx
movl $0x1, %edx
jmp 0x2c28b
movzbl %dl, %ecx
movl $0x1, %edx
cmpl $0xdf, %ecx
jle 0x2c23c
cmpl $0xe0, %ecx
je 0x2c274
cmpl $0xf0, %ecx
je 0x2c27b
cmpl $0xfe, %ecx
jne 0x2c289
movl $0x1, %ecx
jmp 0x2c28b
cmpl $0xc0, %ecx
je 0x2c282
cmpl $0xd0, %ecx
jne 0x2c289
movl $0x4, %ecx
jmp 0x2c28b
andl $0x3f, %ecx
shll $0x8, %ecx
movzbl 0x1(%rdi,%rax), %edx
orl %edx, %ecx
movl $0x2, %edx
jmp 0x2c28b
movl 0x1(%rdi,%rax), %ecx
bswapl %ecx
movl $0x5, %edx
jmp 0x2c28b
movl $0x8, %ecx
jmp 0x2c28b
movl $0x3, %ecx
jmp 0x2c28b
movl $0x2, %ecx
jmp 0x2c28b
xorl %ecx, %ecx
addl %edx, %eax
addl %ecx, %eax
retq
pushq %rax
leaq 0x6d01b(%rip), %rdi     # 0x992b3
leaq 0x6a9b6(%rip), %rsi     # 0x96c55
movl $0x253, %edx            # imm = 0x253
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistPrev
unsigned char *ziplistPrev(unsigned char *zl, unsigned char *p) {
    zlentry entry;

    /* Iterating backwards from ZIP_END should return the tail. When "p" is
     * equal to the first element of the list, we're already at the head,
     * and should return NULL. */
    
    // 如果 p 指向列表末端（列表为空，或者刚开始从表尾向表头迭代）
    // 那么尝试取出列表尾端节点
    if (p[0] == ZIP_END) {
        p = ZIPLIST_ENTRY_TAIL(zl);
        // 尾端节点也指向列表末端，那么列表为空
        return (p[0] == ZIP_END) ? NULL : p;
    
    // 如果 p 指向列表头，那么说明迭代已经完成
    } else if (p == ZIPLIST_ENTRY_HEAD(zl)) {
        return NULL;

    // 既不是表头也不是表尾，从表尾向表头移动指针
    } else {
        // 计算前一个节点的节点数
        entry = zipEntry(p);
        assert(entry.prevrawlen > 0);
        // 移动指针，指向前一个节点
        return p-entry.prevrawlen;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpb $-0x1, (%rsi)
je 0x2c30f
movq %rsi, %rbx
addq $0xa, %rdi
cmpq %rsi, %rdi
je 0x2c322
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c0a0
movl 0x4(%r14), %eax
testq %rax, %rax
je 0x2c32f
subq %rax, %rbx
jmp 0x2c324
movl 0x4(%rdi), %eax
leaq (%rdi,%rax), %rcx
xorl %ebx, %ebx
cmpb $-0x1, (%rdi,%rax)
cmovneq %rcx, %rbx
jmp 0x2c324
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x6a90a(%rip), %rdi     # 0x96c40
leaq 0x6a918(%rip), %rsi     # 0x96c55
movl $0x55c, %edx            # imm = 0x55C
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistGet
unsigned int ziplistGet(unsigned char *p, unsigned char **sstr, unsigned int *slen, long long *sval) {

    zlentry entry;
    if (p == NULL || p[0] == ZIP_END) return 0;
    if (sstr) *sstr = NULL;

    // 取出 p 所指向的节点的各项信息，并保存到结构 entry 中
    // T = O(1)
    entry = zipEntry(p);

    // 节点的值为字符串，将字符串长度保存到 *slen ，字符串保存到 *sstr
    // T = O(1)
    if (ZIP_IS_STR(entry.encoding)) {
        if (sstr) {
            *slen = entry.len;
            *sstr = p+entry.headersize;
        }
    
    // 节点的值为整数，解码值，并将值保存到 *sval
    // T = O(1)
    } else {
        if (sval) {
            *sval = zipLoadInteger(p+entry.headersize,entry.encoding);
        }
    }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x2c3d0
movq %rdi, %rbx
cmpb $-0x1, (%rdi)
je 0x2c3d0
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
testq %rsi, %rsi
je 0x2c383
movq $0x0, (%r15)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2c0a0
movl 0x10(%r13), %eax
movb 0x14(%r13), %cl
movl $0x1, %ebp
cmpb $-0x41, %cl
jbe 0x2c3bd
testq %r14, %r14
je 0x2c3d0
addq %rax, %rbx
movzbl %cl, %esi
movq %rbx, %rdi
callq 0x2c3e1
movq %rax, (%r14)
jmp 0x2c3d0
testq %r15, %r15
je 0x2c3d0
movl 0x14(%rsp), %ecx
movl %ecx, (%r12)
addq %rax, %rbx
movq %rbx, (%r15)
movl %ebp, %eax
addq $0x28, %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/ziplist.c
// Function: zipLoadInteger
static int64_t zipLoadInteger(unsigned char *p, unsigned char encoding) {
    int16_t i16;
    int32_t i32;
    int64_t i64, ret = 0;

    if (encoding == ZIP_INT_8B) {
        ret = ((int8_t*)p)[0];
    } else if (encoding == ZIP_INT_16B) {
        memcpy(&i16,p,sizeof(i16));
        memrev16ifbe(&i16);
        ret = i16;
    } else if (encoding == ZIP_INT_32B) {
        memcpy(&i32,p,sizeof(i32));
        memrev32ifbe(&i32);
        ret = i32;
    } else if (encoding == ZIP_INT_24B) {
        i32 = 0;
        memcpy(((uint8_t*)&i32)+1,p,sizeof(i32)-sizeof(uint8_t));
        memrev32ifbe(&i32);
        ret = i32>>8;
    } else if (encoding == ZIP_INT_64B) {
        memcpy(&i64,p,sizeof(i64));
        memrev64ifbe(&i64);
        ret = i64;
    } else if (encoding >= ZIP_INT_IMM_MIN && encoding <= ZIP_INT_IMM_MAX) {
        ret = (encoding & ZIP_INT_IMM_MASK)-1;
    } else {
        assert(NULL);
    }

    return ret;
}

// Assembly:
cmpl $0xdf, %esi
jle 0x2c406
cmpl $0xe0, %esi
je 0x2c41a
cmpl $0xf0, %esi
je 0x2c41e
cmpl $0xfe, %esi
jne 0x2c433
movsbq (%rdi), %rax
retq
cmpl $0xc0, %esi
je 0x2c42e
cmpl $0xd0, %esi
jne 0x2c433
movslq (%rdi), %rax
retq
movq (%rdi), %rax
retq
movsbq 0x2(%rdi), %rcx
shlq $0x10, %rcx
movzwl (%rdi), %eax
orq %rcx, %rax
retq
movswq (%rdi), %rax
retq
leal 0xf(%rsi), %eax
cmpb $0xd, %al
ja 0x2c446
andb $0xf, %sil
movzbl %sil, %eax
decq %rax
retq
pushq %rax
leaq 0x6ce65(%rip), %rdi     # 0x992b3
leaq 0x6a800(%rip), %rsi     # 0x96c55
movl $0x2d0, %edx            # imm = 0x2D0
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistCompare
unsigned int ziplistCompare(unsigned char *p, unsigned char *sstr, unsigned int slen) {
    zlentry entry;
    unsigned char sencoding;
    long long zval, sval;
    if (p[0] == ZIP_END) return 0;

    // 取出节点
    entry = zipEntry(p);
    if (ZIP_IS_STR(entry.encoding)) {

        // 节点值为字符串，进行字符串对比

        /* Raw compare */
        if (entry.len == slen) {
            // T = O(N)
            return memcmp(p+entry.headersize,sstr,slen) == 0;
        } else {
            return 0;
        }
    } else {
        
        // 节点值为整数，进行整数对比

        /* Try to compare encoded values. Don't compare encoding because
         * different implementations may encoded integers differently. */
        if (zipTryEncoding(sstr,slen,&sval,&sencoding)) {
          // T = O(1)
          zval = zipLoadInteger(p+entry.headersize,entry.encoding);
          return zval == sval;
        }
    }

    return 0;
}

// Assembly:
cmpb $-0x1, (%rdi)
je 0x2c6b4
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2c0a0
movl 0x10(%r15), %r12d
movb 0x14(%r15), %r15b
cmpb $-0x41, %r15b
jbe 0x2c6b8
leaq 0x10(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2c6e7
testl %eax, %eax
je 0x2c6d5
addq %r12, %rbx
movzbl %r15b, %esi
movq %rbx, %rdi
callq 0x2c3e1
cmpq 0x10(%rsp), %rax
jmp 0x2c6d0
xorl %eax, %eax
jmp 0x2c6e3
cmpl %ebp, 0x1c(%rsp)
jne 0x2c6d5
addq %r12, %rbx
movl %ebp, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f6a0
testl %eax, %eax
sete %al
jmp 0x2c6d7
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: zipTryEncoding
static int zipTryEncoding(unsigned char *entry, unsigned int entrylen, long long *v, unsigned char *encoding) {
    long long value;

    // 忽略太长或太短的字符串
    if (entrylen >= 32 || entrylen == 0) return 0;

    // 尝试转换
    // T = O(N)
    if (string2ll((char*)entry,entrylen,&value)) {

        /* Great, the string can be encoded. Check what's the smallest
         * of our encoding types that can hold this value. */
        // 转换成功，以从小到大的顺序检查适合值 value 的编码方式
        if (value >= 0 && value <= 12) {
            *encoding = ZIP_INT_IMM_MIN+value;
        } else if (value >= INT8_MIN && value <= INT8_MAX) {
            *encoding = ZIP_INT_8B;
        } else if (value >= INT16_MIN && value <= INT16_MAX) {
            *encoding = ZIP_INT_16B;
        } else if (value >= INT24_MIN && value <= INT24_MAX) {
            *encoding = ZIP_INT_24B;
        } else if (value >= INT32_MIN && value <= INT32_MAX) {
            *encoding = ZIP_INT_32B;
        } else {
            *encoding = ZIP_INT_64B;
        }

        // 记录值到指针
        *v = value;

        // 返回转换成功标识
        return 1;
    }

    // 转换失败
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leal -0x20(%rsi), %eax
xorl %ebp, %ebp
cmpl $-0x1f, %eax
jb 0x2c761
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %esi
leaq 0x8(%rsp), %rdx
callq 0x2fec4
testl %eax, %eax
je 0x2c761
movq 0x8(%rsp), %rax
cmpq $0xc, %rax
ja 0x2c71f
leal -0xf(%rax), %ecx
jmp 0x2c756
movsbq %al, %rdx
movb $-0x2, %cl
cmpq %rax, %rdx
je 0x2c756
movswq %ax, %rdx
movb $-0x40, %cl
cmpq %rax, %rdx
je 0x2c756
leaq 0x800000(%rax), %rdx
movb $-0x10, %cl
cmpq $0x1000000, %rdx        # imm = 0x1000000
jb 0x2c756
movslq %eax, %rcx
cmpq %rax, %rcx
setne %cl
shlb $0x4, %cl
addb $-0x30, %cl
movb %cl, (%r14)
movq %rax, (%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistLen
unsigned int ziplistLen(unsigned char *zl) {

    unsigned int len = 0;

    // 节点数小于 UINT16_MAX
    // T = O(1)
    if (intrev16ifbe(ZIPLIST_LENGTH(zl)) < UINT16_MAX) {
        len = intrev16ifbe(ZIPLIST_LENGTH(zl));

    // 节点数大于 UINT16_MAX 时，需要遍历整个列表才能计算出节点数
    // T = O(N)
    } else {
        unsigned char *p = zl+ZIPLIST_HEADER_SIZE;
        while (*p != ZIP_END) {
            p += zipRawEntryLength(p);
            len++;
        }

        /* Re-store length if small enough */
        if (len < UINT16_MAX) ZIPLIST_LENGTH(zl) = intrev16ifbe(len);
    }

    return len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movzwl 0x8(%rdi), %ebp
cmpl $0xffff, %ebp           # imm = 0xFFFF
jne 0x2c9ee
movq %rdi, %rbx
cmpb $-0x1, 0xa(%rdi)
je 0x2c9e0
leaq 0xa(%rbx), %r14
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x2c1c5
movl %eax, %eax
incl %ebp
cmpb $-0x1, (%r14,%rax)
leaq (%r14,%rax), %r14
jne 0x2c9c7
jmp 0x2c9e2
xorl %ebp, %ebp
cmpl $0xfffe, %ebp           # imm = 0xFFFE
ja 0x2c9ee
movw %bp, 0x8(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: getStringObjectSdsUsedMemory
size_t getStringObjectSdsUsedMemory(robj *o) {
    redisAssertWithInfo(NULL,o,o->type == REDIS_STRING);
    switch(o->encoding) {
    case REDIS_ENCODING_RAW: return zmalloc_size_sds(o->ptr);
    case REDIS_ENCODING_EMBSTR: return sdslen(o->ptr);
    default: return 0; /* Just integer encoding for now. */
    }
}

// Assembly:
movq %rdi, %rsi
movl (%rdi), %eax
testb $0xf, %al
jne 0x2cd0e
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x2cd02
testl %eax, %eax
jne 0x2cd0b
movq 0x8(%rsi), %rdi
addq $-0x8, %rdi
jmp 0x7e28c
movq 0x8(%rsi), %rax
movslq -0x8(%rax), %rax
retq
xorl %eax, %eax
retq
pushq %rax
leaq 0x6a010(%rip), %rdx     # 0x96d26
leaq 0x6a021(%rip), %rcx     # 0x96d3e
xorl %edi, %edi
movl $0x31, %r8d
callq 0x4d872
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: prepareClientToWrite
int prepareClientToWrite(redisClient *c) {

    // LUA 脚本环境所使用的伪客户端总是可写的
    if (c->flags & REDIS_LUA_CLIENT) return REDIS_OK;
    
    // 客户端是主服务器并且不接受查询，
    // 那么它是不可写的，出错
    if ((c->flags & REDIS_MASTER) &&
        !(c->flags & REDIS_MASTER_FORCE_REPLY)) return REDIS_ERR;

    // 无连接的伪客户端总是不可写的
    if (c->fd <= 0) return REDIS_ERR; /* Fake client */

    // 一般情况，为客户端套接字安装写处理器到事件循环
    if (c->bufpos == 0 && listLength(c->reply) == 0 &&
        (c->replstate == REDIS_REPL_NONE ||
         c->replstate == REDIS_REPL_ONLINE) &&
        aeCreateFileEvent(server.el, c->fd, AE_WRITABLE,
        sendReplyToClient, c) == AE_ERR) return REDIS_ERR;

    return REDIS_OK;
}

// Assembly:
pushq %rbx
movl 0x90(%rdi), %eax
xorl %ebx, %ebx
btl $0x8, %eax
jb 0x2d103
andl $0x2002, %eax           # imm = 0x2002
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
je 0x2d103
movq %rdi, %r8
movl (%rdi), %esi
testl %esi, %esi
jle 0x2d103
cmpl $0x0, 0x170(%r8)
jne 0x2d101
movq 0x60(%r8), %rax
cmpq $0x0, 0x28(%rax)
je 0x2d107
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
retq
movl 0x98(%r8), %eax
cmpl $0x9, %eax
je 0x2d117
testl %eax, %eax
jne 0x2d101
leaq 0x9ce8a(%rip), %rax     # 0xc9fa8
movq 0x28(%rax), %rdi
leaq 0x11(%rip), %rcx        # 0x2d13a
movl $0x2, %edx
callq 0x209d7
cmpl $-0x1, %eax
jne 0x2d101
jmp 0x2d103
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: dupLastObjectIfNeeded
robj *dupLastObjectIfNeeded(list *reply) {
    robj *new, *cur;
    listNode *ln;
    redisAssert(listLength(reply) > 0);
    ln = listLast(reply);
    cur = listNodeValue(ln);
    if (cur->refcount > 1) {
        new = dupStringObject(cur);
        decrRefCount(cur);
        listNodeValue(ln) = new;
    }
    return listNodeValue(ln);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x0, 0x28(%rdi)
je 0x2d36f
movq 0x8(%rdi), %r15
movq 0x10(%r15), %rbx
cmpl $0x2, 0x4(%rbx)
jl 0x2d365
movq %rbx, %rdi
callq 0x30493
movq %rax, %r14
movq %rbx, %rdi
callq 0x30834
movq %r14, 0x10(%r15)
movq 0x10(%r15), %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x699d5(%rip), %rdi     # 0x96d4b
leaq 0x699c1(%rip), %rsi     # 0x96d3e
movl $0xf7, %edx
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyToBuffer
int _addReplyToBuffer(redisClient *c, char *s, size_t len) {
    size_t available = sizeof(c->buf)-c->bufpos;

    // 正准备关闭客户端，无须再发送内容
    if (c->flags & REDIS_CLOSE_AFTER_REPLY) return REDIS_OK;

    /* If there already are entries in the reply list, we cannot
     * add anything more to the static buffer. */
    // 回复链表里已经有内容，再添加内容到 c->buf 里面就是错误了
    if (listLength(c->reply) > 0) return REDIS_ERR;

    /* Check that the buffer has enough space available for this string. */
    // 空间必须满足
    if (len > available) return REDIS_ERR;

    // 复制内容到 c->buf 里面
    memcpy(c->buf+c->bufpos,s,len);
    c->bufpos+=len;

    return REDIS_OK;
}

// Assembly:
xorl %eax, %eax
testb $0x40, 0x90(%rdi)
jne 0x2d3f3
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movslq 0x170(%rdi), %rcx
movl $0x4000, %eax           # imm = 0x4000
subq %rcx, %rax
movq 0x60(%rdi), %rdx
cmpq $0x0, 0x28(%rdx)
setne %dl
cmpq %rbx, %rax
setb %al
orb %dl, %al
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x2d3ec
leaq (%r14,%rcx), %rdi
addq $0x174, %rdi            # imm = 0x174
movq %rbx, %rdx
callq 0x1fbd0
addl %ebx, 0x170(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyObjectToList
void _addReplyObjectToList(redisClient *c, robj *o) {
    robj *tail;

    // 客户端即将被关闭，无须再发送回复
    if (c->flags & REDIS_CLOSE_AFTER_REPLY) return;

    // 链表中无缓冲块，直接将对象追加到链表中
    if (listLength(c->reply) == 0) {
        incrRefCount(o);
        listAddNodeTail(c->reply,o);

        // 链表中已有缓冲块，尝试将回复添加到块内
        // 如果当前的块不能容纳回复的话，那么新建一个块
        c->reply_bytes += getStringObjectSdsUsedMemory(o);
    } else {

        // 取出表尾的 SDS
        tail = listNodeValue(listLast(c->reply));

        /* Append to this object when possible. */
        // 如果表尾 SDS 的已用空间加上对象的长度，小于 REDIS_REPLY_CHUNK_BYTES
        // 那么将新对象的内容拼接到表尾 SDS 的末尾
        if (tail->ptr != NULL &&
            tail->encoding == REDIS_ENCODING_RAW &&
            sdslen(tail->ptr)+sdslen(o->ptr) <= REDIS_REPLY_CHUNK_BYTES)
        {
            c->reply_bytes -= zmalloc_size_sds(tail->ptr);
            tail = dupLastObjectIfNeeded(c->reply);
            // 拼接
            tail->ptr = sdscatlen(tail->ptr,o->ptr,sdslen(o->ptr));
            c->reply_bytes += zmalloc_size_sds(tail->ptr);

        // 直接将对象追加到末尾
        } else {
            incrRefCount(o);
            listAddNodeTail(c->reply,o);
            c->reply_bytes += getStringObjectSdsUsedMemory(o);
        }
    }

    // 检查回复缓冲区的大小，如果超过系统限制的话，那么关闭客户端
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
testb $0x40, 0x90(%rdi)
jne 0x2d47a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x60(%rdi), %rax
cmpq $0x0, 0x28(%rax)
je 0x2d47b
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x2d47b
testb $-0x10, (%rax)
jne 0x2d47b
movslq -0x8(%rdi), %rax
movq 0x8(%r14), %rcx
movslq -0x8(%rcx), %rcx
addq %rax, %rcx
cmpq $0x4000, %rcx           # imm = 0x4000
ja 0x2d47b
addq $-0x8, %rdi
callq 0x7e28c
subq %rax, 0x68(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2d334
movq %rax, %r15
movq 0x8(%rax), %rdi
movq 0x8(%r14), %rsi
movslq -0x8(%rsi), %rdx
callq 0x28380
movq %rax, 0x8(%r15)
leaq -0x8(%rax), %rdi
callq 0x7e28c
jmp 0x2d497
retq
movq %r14, %rdi
callq 0x3041b
movq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x2045f
movq %r14, %rdi
callq 0x2ccdd
addq %rax, 0x68(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2d4a8
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: asyncCloseClientOnOutputBufferLimitReached
void asyncCloseClientOnOutputBufferLimitReached(redisClient *c) {
    redisAssert(c->reply_bytes < ULONG_MAX-(1024*64));

    // 已经被标记了
    if (c->reply_bytes == 0 || c->flags & REDIS_CLOSE_ASAP) return;

    // 检查限制
    if (checkClientOutputBufferLimits(c)) {
        sds client = catClientInfoString(sdsempty(),c);

        // 异步关闭
        freeClientAsync(c);
        redisLog(REDIS_WARNING,"Client %s scheduled to be closed ASAP for overcoming of output buffer limits.", client);
        sdsfree(client);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x68(%rdi), %rax
cmpq $-0x10001, %rax         # imm = 0xFFFEFFFF
jae 0x2d546
testq %rax, %rax
je 0x2d53e
movq %rdi, %rbx
testb $0x4, 0x91(%rdi)
jne 0x2d53e
movq %rbx, %rdi
callq 0x2f80f
testl %eax, %eax
je 0x2d53e
callq 0x281b2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2ee21
movq %rax, %r14
movl 0x90(%rbx), %eax
btl $0xa, %eax
jb 0x2d519
orl $0x400, %eax            # imm = 0x400
movl %eax, 0x90(%rbx)
leaq 0x9ca9e(%rip), %rax     # 0xc9fa8
movq 0x1b8(%rax), %rdi
movq %rbx, %rsi
callq 0x2045f
leaq 0x69ca5(%rip), %rsi     # 0x971c5
movl $0x3, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x23064
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x28204
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x69c53(%rip), %rdi     # 0x971a0
leaq 0x697ea(%rip), %rsi     # 0x96d3e
movl $0x81a, %edx            # imm = 0x81A
callq 0x4d037
movl $0x1, %edi
callq 0x1f3b0
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplySdsToList
void _addReplySdsToList(redisClient *c, sds s) {
    robj *tail;

    if (c->flags & REDIS_CLOSE_AFTER_REPLY) {
        sdsfree(s);
        return;
    }

    if (listLength(c->reply) == 0) {
        listAddNodeTail(c->reply,createObject(REDIS_STRING,s));
        c->reply_bytes += zmalloc_size_sds(s);
    } else {
        tail = listNodeValue(listLast(c->reply));

        /* Append to this object when possible. */
        if (tail->ptr != NULL && tail->encoding == REDIS_ENCODING_RAW &&
            sdslen(tail->ptr)+sdslen(s) <= REDIS_REPLY_CHUNK_BYTES)
        {
            c->reply_bytes -= zmalloc_size_sds(tail->ptr);
            tail = dupLastObjectIfNeeded(c->reply);
            tail->ptr = sdscatlen(tail->ptr,s,sdslen(s));
            c->reply_bytes += zmalloc_size_sds(tail->ptr);
            sdsfree(s);
        } else {
            listAddNodeTail(c->reply,createObject(REDIS_STRING,s));
            c->reply_bytes += zmalloc_size_sds(s);
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
testb $0x40, 0x90(%rdi)
jne 0x2d5f5
movq %rdi, %rbx
movq 0x60(%rdi), %r15
cmpq $0x0, 0x28(%r15)
je 0x2d602
movq 0x8(%r15), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x2d602
testb $-0x10, (%rax)
jne 0x2d602
movslq -0x8(%rdi), %rax
movslq -0x8(%r14), %rcx
addq %rax, %rcx
cmpq $0x4000, %rcx           # imm = 0x4000
ja 0x2d602
addq $-0x8, %rdi
callq 0x7e28c
subq %rax, 0x68(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2d334
movq %rax, %r15
movq 0x8(%rax), %rdi
movslq -0x8(%r14), %rdx
movq %r14, %rsi
callq 0x28380
movq %rax, 0x8(%r15)
leaq -0x8(%rax), %rdi
callq 0x7e28c
addq %rax, 0x68(%rbx)
movq %r14, %rdi
callq 0x28204
jmp 0x2d627
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x28204
xorl %edi, %edi
movq %r14, %rsi
callq 0x302c4
movq %r15, %rdi
movq %rax, %rsi
callq 0x2045f
addq $-0x8, %r14
movq %r14, %rdi
callq 0x7e28c
addq %rax, 0x68(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2d4a8
// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/networking.c
// Function: addReplyStringToList
void _addReplyStringToList(redisClient *c, char *s, size_t len) {
    robj *tail;

    if (c->flags & REDIS_CLOSE_AFTER_REPLY) return;

    if (listLength(c->reply) == 0) {
        // 为字符串创建字符串对象并追加到回复链表末尾
        robj *o = createStringObject(s,len);

        listAddNodeTail(c->reply,o);
        c->reply_bytes += getStringObjectSdsUsedMemory(o);
    } else {
        tail = listNodeValue(listLast(c->reply));

        /* Append to this object when possible. */
        if (tail->ptr != NULL && tail->encoding == REDIS_ENCODING_RAW &&
            sdslen(tail->ptr)+len <= REDIS_REPLY_CHUNK_BYTES)
        {
            c->reply_bytes -= zmalloc_size_sds(tail->ptr);
            tail = dupLastObjectIfNeeded(c->reply);
            // 将字符串拼接到一个 SDS 之后
            tail->ptr = sdscatlen(tail->ptr,s,len);
            c->reply_bytes += zmalloc_size_sds(tail->ptr);
        } else {
            // 为字符串创建字符串对象并追加到回复链表末尾
            robj *o = createStringObject(s,len);

            listAddNodeTail(c->reply,o);
            c->reply_bytes += getStringObjectSdsUsedMemory(o);
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
testb $0x40, 0x90(%rdi)
jne 0x2d6b6
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x60(%rdi), %rax
cmpq $0x0, 0x28(%rax)
je 0x2d6b7
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x2d6b7
testb $-0x10, (%rax)
jne 0x2d6b7
movslq -0x8(%rdi), %rax
addq %r14, %rax
cmpq $0x4000, %rax           # imm = 0x4000
ja 0x2d6b7
addq $-0x8, %rdi
callq 0x7e28c
subq %rax, 0x68(%rbx)
movq 0x60(%rbx), %rdi
callq 0x2d334
movq %rax, %r12
movq 0x8(%rax), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x28380
movq %rax, 0x8(%r12)
leaq -0x8(%rax), %rdi
callq 0x7e28c
jmp 0x2d6d9
retq
movq %r15, %rdi
movq %r14, %rsi
callq 0x303b7
movq %rax, %r14
movq 0x60(%rbx), %rdi
movq %rax, %rsi
callq 0x2045f
movq %r14, %rdi
callq 0x2ccdd
addq %rax, 0x68(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2d4a8
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2d0c5
testl %eax, %eax
jne 0x2d908
testb $0x40, 0x90(%r14)
jne 0x2d908
movslq -0x8(%rbx), %r15
movslq 0x170(%r14), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
movq 0x60(%r14), %rdx
cmpq $0x0, 0x28(%rdx)
setne %dl
cmpq %r15, %rcx
setb %cl
orb %dl, %cl
je 0x2d8eb
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2d568
leaq (%r14,%rax), %rdi
addq $0x174, %rdi            # imm = 0x174
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1fbd0
addl %r15d, 0x170(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x28204
// File: /workspace/github_c_makefile_star2_O1/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 0x2dbb0
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 0x281b2
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2867c
movq %rax, %rbx
movslq -0x8(%rax), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x2dae1
movq %rbx, %rdi
callq 0x28204
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2d0c5
testl %eax, %eax
je 0x2dc1e
xorl %eax, %eax
jmp 0x2dc3e
movq 0x60(%rbx), %r14
xorl %edi, %edi
xorl %esi, %esi
callq 0x302c4
movq %r14, %rdi
movq %rax, %rsi
callq 0x2045f
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2dd0a
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r12
callq 0x281b2
leaq 0x6911b(%rip), %rsi     # 0x96d8b
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x28760
movq %rax, 0x8(%r12)
andb $0xf, (%r12)
leaq -0x8(%rax), %rdi
callq 0x7e28c
addq %rax, 0x68(%rbx)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x2dcf7
movq 0x10(%rax), %r15
cmpq $0x0, 0x8(%r15)
je 0x2dcf7
movq 0x8(%r12), %rdi
addq $-0x8, %rdi
callq 0x7e28c
subq %rax, 0x68(%rbx)
movq %r15, %rdi
callq 0x2ccdd
subq %rax, 0x68(%rbx)
movq 0x8(%r12), %rdi
movq 0x8(%r15), %rsi
movslq -0x8(%rsi), %rdx
callq 0x28380
movq %rax, 0x8(%r12)
leaq -0x8(%rax), %rdi
callq 0x7e28c
addq %rax, 0x68(%rbx)
movq 0x60(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x20544
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2d4a8
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2dded
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 0x2dfa7
leaq 0x9ca0c(%rip), %rax     # 0xca800
movq 0x50(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2d6f0
// File: /workspace/github_c_makefile_star2_O1/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 0x2de39
leaq 0x9c9d1(%rip), %rcx     # 0xca800
movq 0x13a30(%rcx,%rax,8), %rsi
jmp 0x2de5b
cmpq $0x20, %rax
setge %cl
cmpb $0x24, %dl
setne %sil
orb %cl, %sil
jne 0x2de6b
leaq 0x9c9ad(%rip), %rcx     # 0xca800
movq 0x13b30(%rcx,%rax,8), %rsi
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
jmp 0x2d6f0
leaq 0x1(%rsp), %rdi
movb %dl, -0x1(%rdi)
movl $0x7f, %esi
movq %rax, %rdx
callq 0x2fe12
cltq
movq %rsp, %rsi
movw $0xa0d, 0x1(%rax,%rsi)  # imm = 0xA0D
addl $0x3, %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x2d915
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2debe
testq %rsi, %rsi
jne 0x2dece
leaq 0x9c94b(%rip), %rax     # 0xca800
movq 0x20(%rax), %rsi
jmp 0x2d6f0
leaq 0x9c93b(%rip), %rax     # 0xca800
movq 0x28(%rax), %rsi
jmp 0x2d6f0
movl $0x3a, %edx
jmp 0x2de07
// File: /workspace/github_c_makefile_star2_O1/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 0x203b0
movq 0x60(%rbx), %rdi
callq 0x20608
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_O1/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 $0x1e8, %r14d           # imm = 0x1E8
addq 0x97f2c(%rip), %r14     # 0xc5fb8
movl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movl $0x2e, %ecx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r12, %r8
callq 0x21bff
cmpl $-0x1, %eax
je 0x2e0e2
movl %eax, %ebp
movl 0xc(%rsp), %ecx
movl $0x1, %edi
leaq 0x68cf5(%rip), %rsi     # 0x96dbd
movq %r15, %rdx
xorl %eax, %eax
callq 0x23064
movl %ebp, %edi
xorl %esi, %esi
callq 0x2e11a
incl %r13d
jne 0x2e09c
jmp 0x2e10b
callq 0x1f810
cmpl $0xb, (%rax)
je 0x2e10b
movl $0x1e8, %edx            # imm = 0x1E8
addq 0x97ec0(%rip), %rdx     # 0xc5fb8
leaq 0x68c9e(%rip), %rsi     # 0x96d9d
movl $0x3, %edi
xorl %eax, %eax
callq 0x23064
addq $0x48, %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/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 $0xfffffc18, %r12d      # imm = 0xFFFFFC18
movl $0x1e8, %r14d           # imm = 0x1E8
addq 0x97de5(%rip), %r14     # 0xc5fb8
leaq 0x9bdce(%rip), %r13     # 0xc9fa8
leaq 0x68beb(%rip), %r15     # 0x96dcc
movq %r14, %rdi
movl %ebx, %esi
callq 0x21ce7
cmpl $-0x1, %eax
je 0x2e21b
movl %eax, %ebp
movq 0x118(%r13), %rdx
movl $0x1, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x23064
movl %ebp, %edi
movl $0x800, %esi            # imm = 0x800
callq 0x2e11a
incl %r12d
jne 0x2e1e1
jmp 0x2e225
callq 0x1f810
cmpl $0xb, (%rax)
jne 0x2e234
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1e8, %edx            # imm = 0x1E8
addq 0x97d78(%rip), %rdx     # 0xc5fb8
leaq 0x68b56(%rip), %rsi     # 0x96d9d
movl $0x3, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x23064
// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x0, 0x30(%rdi)
jle 0x2e652
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x30834
incq %r14
movslq 0x30(%rbx), %rax
cmpq %rax, %r14
jl 0x2e639
movl $0x0, 0x30(%rbx)
movq $0x0, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9b906(%rip), %r14     # 0xc9fa8
movq 0x1b8(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0x2e6d7
movq (%rax), %rbx
movq 0x10(%rbx), %rdi
andl $0xfffffbff, 0x90(%rdi) # imm = 0xFFFFFBFF
callq 0x2e287
movq 0x1b8(%r14), %rdi
movq %rbx, %rsi
callq 0x20544
jmp 0x2e6a2
addq $0x8, %rsp
popq %rbx
popq %r14
retq