LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: redisAsciiArt
void redisAsciiArt(void) {
#include "asciilogo.h"
    char *buf = zmalloc(1024*16);
    char *mode = "stand alone";

    if (server.cluster_enabled) mode = "cluster";
    else if (server.sentinel_mode) mode = "sentinel";

    snprintf(buf,1024*16,ascii_logo,
        REDIS_VERSION,
        redisGitSHA1(),
        strtol(redisGitDirty(),NULL,10) > 0,
        (sizeof(long) == 8) ? "64" : "32",
        mode, server.port,
        (long) getpid()
    );
    redisLogRaw(REDIS_NOTICE|REDIS_LOG_RAW,buf);
    zfree(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
leaq 0xb4bfe(%rip), %rax     # 0xe034e
movq %rax, -0x10(%rbp)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2e130
movq %rax, -0x18(%rbp)
leaq 0xb5052(%rip), %rax     # 0xe07bb
movq %rax, -0x20(%rbp)
cmpl $0x0, 0xe8940(%rip)     # 0x1140b4
je 0x2b783
leaq 0xb2ed2(%rip), %rax     # 0xde64f
movq %rax, -0x20(%rbp)
jmp 0x2b799
cmpl $0x0, 0xe81f2(%rip)     # 0x11397c
je 0x2b797
leaq 0xbdf0b(%rip), %rax     # 0xe969e
movq %rax, -0x20(%rbp)
jmp 0x2b799
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x347a0
movq %rax, -0x40(%rbp)
callq 0x347b0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x1f6c0
cmpq $0x0, %rax
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl 0xe819b(%rip), %eax     # 0x113980
movl %eax, -0x24(%rbp)
callq 0x1f410
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %r8
movl -0x34(%rbp), %r9d
movq -0x30(%rbp), %r11
movl -0x24(%rbp), %r10d
cltq
movl $0x4000, %esi           # imm = 0x4000
leaq 0xb51d5(%rip), %rcx     # 0xe09e8
leaq 0xb4fad(%rip), %rbx     # 0xe07c7
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x1f120
movq -0x18(%rbp), %rsi
movl $0x402, %edi            # imm = 0x402
callq 0x24dd0
movq -0x18(%rbp), %rdi
callq 0x2e3a0
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: loadDataFromDisk
void loadDataFromDisk(void) {
    // 记录开始时间
    long long start = ustime();

    // AOF 持久化已打开？
    if (server.aof_state == REDIS_AOF_ON) {
        // 尝试载入 AOF 文件
        if (loadAppendOnlyFile(server.aof_filename) == REDIS_OK)
            // 打印载入信息，并计算载入耗时长度
            redisLog(REDIS_NOTICE,"DB loaded from append only file: %.3f seconds",(float)(ustime()-start)/1000000);
    // AOF 持久化未打开
    } else {
        // 尝试载入 RDB 文件
        if (rdbLoad(server.rdb_filename) == REDIS_OK) {
            // 打印载入信息，并计算载入耗时长度
            redisLog(REDIS_NOTICE,"DB loaded from disk: %.3f seconds",
                (float)(ustime()-start)/1000000);
        } else if (errno != ENOENT) {
            redisLog(REDIS_WARNING,"Fatal error loading the DB: %s. Exiting.",strerror(errno));
            exit(1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x252a0
movq %rax, -0x8(%rbp)
cmpl $0x1, 0xe8490(%rip)     # 0x113dc8
jne 0x2b97e
movq 0xe848f(%rip), %rdi     # 0x113dd0
callq 0x5fac0
cmpl $0x0, %eax
jne 0x2b97c
callq 0x252a0
subq -0x8(%rbp), %rax
cvtsi2ss %rax, %xmm0
movss 0xb297f(%rip), %xmm1    # 0xde2e0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x2, %edi
leaq 0xb4e6f(%rip), %rsi     # 0xe07e4
movb $0x1, %al
callq 0x24fb0
jmp 0x2b9fc
movq 0xe84fb(%rip), %rdi     # 0x113e80
callq 0x45f70
cmpl $0x0, %eax
jne 0x2b9c2
callq 0x252a0
subq -0x8(%rbp), %rax
cvtsi2ss %rax, %xmm0
movss 0xb293b(%rip), %xmm1    # 0xde2e0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x2, %edi
leaq 0xb4e59(%rip), %rsi     # 0xe0812
movb $0x1, %al
callq 0x24fb0
jmp 0x2b9fa
callq 0x1f820
cmpl $0x2, (%rax)
je 0x2b9f8
callq 0x1f820
movl (%rax), %edi
callq 0x1f630
movq %rax, %rdx
movl $0x3, %edi
leaq 0xb4e4d(%rip), %rsi     # 0xe0834
movb $0x0, %al
callq 0x24fb0
movl $0x1, %edi
callq 0x1f2c0
jmp 0x2b9fa
jmp 0x2b9fc
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdsnewlen
sds sdsnewlen(const void *init, size_t initlen) {

    struct sdshdr *sh;

    // 根据是否有初始化内容，选择适当的内存分配方式
    // T = O(N)
    if (init) {
        // zmalloc 不初始化所分配的内存
        sh = zmalloc(sizeof(struct sdshdr)+initlen+1);
    } else {
        // zcalloc 将分配的内存全部初始化为 0
        sh = zcalloc(sizeof(struct sdshdr)+initlen+1);
    }

    // 内存分配失败，返回
    if (sh == NULL) return NULL;

    // 设置初始化长度
    sh->len = initlen;
    // 新 sds 不预留任何空间
    sh->free = 0;
    // 如果有指定初始化内容，将它们复制到 sdshdr 的 buf 中
    // T = O(N)
    if (initlen && init)
        memcpy(sh->buf, init, initlen);
    // 以 \0 结尾
    sh->buf[initlen] = '\0';

    // 返回 buf 部分，而不是整个 sdshdr
    return (char*)sh->buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2c02e
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
addq $0x1, %rdi
callq 0x2e130
movq %rax, -0x20(%rbp)
jmp 0x2c043
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
addq $0x1, %rdi
callq 0x2e1d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2c054
movq $0x0, -0x8(%rbp)
jmp 0x2c0a7
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x4(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x2c08e
cmpq $0x0, -0x10(%rbp)
je 0x2c08e
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1fbf0
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, 0x8(%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdsMakeRoomFor
sds sdsMakeRoomFor(sds s, size_t addlen) {

    struct sdshdr *sh, *newsh;

    // 获取 s 目前的空余空间长度
    size_t free = sdsavail(s);

    size_t len, newlen;

    // s 目前的空余空间已经足够，无须再进行扩展，直接返回
    if (free >= addlen) return s;

    // 获取 s 目前已占用空间的长度
    len = sdslen(s);
    sh = (void*) (s-(sizeof(struct sdshdr)));

    // s 最少需要的长度
    newlen = (len+addlen);

    // 根据新长度，为 s 分配新空间所需的大小
    if (newlen < SDS_MAX_PREALLOC)
        // 如果新长度小于 SDS_MAX_PREALLOC 
        // 那么为它分配两倍于所需长度的空间
        newlen *= 2;
    else
        // 否则，分配长度为目前长度加上 SDS_MAX_PREALLOC
        newlen += SDS_MAX_PREALLOC;
    // T = O(N)
    newsh = zrealloc(sh, sizeof(struct sdshdr)+newlen+1);

    // 内存不足，分配失败，返回
    if (newsh == NULL) return NULL;

    // 更新 sds 的空余长度
    newsh->free = newlen - len;

    // 返回 sds
    return newsh->buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2bfe0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x2c254
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2c2e5
movq -0x10(%rbp), %rdi
callq 0x2bfc0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x100000, -0x40(%rbp)  # imm = 0x100000
jae 0x2c290
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x40(%rbp)
jmp 0x2c29e
movq -0x40(%rbp), %rax
addq $0x100000, %rax         # imm = 0x100000
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
addq $0x1, %rsi
callq 0x2e270
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2c2c8
movq $0x0, -0x8(%rbp)
jmp 0x2c2e5
movq -0x40(%rbp), %rax
subq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdsIncrLen
void sdsIncrLen(sds s, int incr) {
    struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));

    // 确保 sds 空间足够
    assert(sh->free >= incr);

    // 更新属性
    sh->len += incr;
    sh->free -= incr;

    // 这个 assert 其实可以忽略
    // 因为前一个 assert 已经确保 sh->free - incr >= 0 了
    assert(sh->free >= 0);

    // 放置新的结尾符号
    s[sh->len] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0xc(%rbp), %eax
jl 0x2c399
jmp 0x2c3b8
leaq 0xb48ec(%rip), %rdi     # 0xe0c8c
leaq 0xb48f6(%rip), %rsi     # 0xe0c9d
movl $0x164, %edx            # imm = 0x164
leaq 0xb48f0(%rip), %rcx     # 0xe0ca3
callq 0x1f2d0
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0x2c3de
jmp 0x2c3fd
leaq 0xb48d8(%rip), %rdi     # 0xe0cbd
leaq 0xb48b1(%rip), %rsi     # 0xe0c9d
movl $0x16c, %edx            # imm = 0x16C
leaq 0xb48ab(%rip), %rcx     # 0xe0ca3
callq 0x1f2d0
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdsgrowzero
sds sdsgrowzero(sds s, size_t len) {
    struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
    size_t totlen, curlen = sh->len;

    // 如果 len 比字符串的现有长度小，
    // 那么直接返回，不做动作
    if (len <= curlen) return s;

    // 扩展 sds
    // T = O(N)
    s = sdsMakeRoomFor(s,len-curlen);
    // 如果内存不足，直接返回
    if (s == NULL) return NULL;

    /* Make sure added region doesn't contain garbage */
    // 将新分配的空间用 0 填充，防止出现垃圾内容
    // T = O(N)
    sh = (void*)(s-(sizeof(struct sdshdr)));
    memset(s+curlen,0,(len-curlen+1)); /* also set trailing \0 byte */

    // 更新属性
    totlen = sh->len+sh->free;
    sh->len = len;
    sh->free = totlen-sh->len;

    // 返回新的 sds
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x30(%rbp), %rax
ja 0x2c45e
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2c4e9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
subq -0x30(%rbp), %rsi
callq 0x2c220
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2c484
movq $0x0, -0x8(%rbp)
jmp 0x2c4e9
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
addq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rdx
subq -0x30(%rbp), %rdx
addq $0x1, %rdx
xorl %esi, %esi
callq 0x1f110
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq -0x20(%rbp), %rcx
addl 0x4(%rcx), %eax
cltq
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdscatlen
sds sdscatlen(sds s, const void *t, size_t len) {
    
    struct sdshdr *sh;
    
    // 原有字符串长度
    size_t curlen = sdslen(s);

    // 扩展 sds 空间
    // T = O(N)
    s = sdsMakeRoomFor(s,len);

    // 内存不足？直接返回
    if (s == NULL) return NULL;

    // 复制 t 中的内容到字符串后部
    // T = O(N)
    sh = (void*) (s-(sizeof(struct sdshdr)));
    memcpy(s+curlen, t, len);

    // 更新属性
    sh->len = curlen+len;
    sh->free = sh->free-len;

    // 添加新结尾符号
    s[curlen+len] = '\0';

    // 返回新 sds
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2bfc0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2c220
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2c543
movq $0x0, -0x8(%rbp)
jmp 0x2c5a1
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
addq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1fbf0
movq -0x30(%rbp), %rax
addq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movslq 0x4(%rax), %rax
subq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
addq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdscpylen
sds sdscpylen(sds s, const char *t, size_t len) {

    struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));

    // sds 现有 buf 的长度
    size_t totlen = sh->free+sh->len;

    // 如果 s 的 buf 长度不满足 len ，那么扩展它
    if (totlen < len) {
        // T = O(N)
        s = sdsMakeRoomFor(s,len-sh->len);
        if (s == NULL) return NULL;
        sh = (void*) (s-(sizeof(struct sdshdr)));
        totlen = sh->free+sh->len;
    }

    // 复制内容
    // T = O(N)
    memcpy(s, t, len);

    // 添加终结符号
    s[len] = '\0';

    // 更新属性
    sh->len = len;
    sh->free = totlen-len;

    // 返回新的 sds
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
addl (%rcx), %eax
cltq
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x2c6b8
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rax
movslq (%rax), %rax
subq %rax, %rsi
callq 0x2c220
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2c699
movq $0x0, -0x8(%rbp)
jmp 0x2c6fa
movq -0x10(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
addl (%rcx), %eax
cltq
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1fbf0
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
subq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdscatvprintf
sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
    va_list cpy;
    char staticbuf[1024], *buf = staticbuf, *t;
    size_t buflen = strlen(fmt)*2;

    /* We try to start using a static buffer for speed.
     * If not possible we revert to heap allocation. */
    if (buflen > sizeof(staticbuf)) {
        buf = zmalloc(buflen);
        if (buf == NULL) return NULL;
    } else {
        buflen = sizeof(staticbuf);
    }

    /* Try with buffers two times bigger every time we fail to
     * fit the string in the current buffer size. */
    while(1) {
        buf[buflen-2] = '\0';
        va_copy(cpy,ap);
        // T = O(N)
        vsnprintf(buf, buflen, fmt, cpy);
        if (buf[buflen-2] != '\0') {
            if (buf != staticbuf) zfree(buf);
            buflen *= 2;
            buf = zmalloc(buflen);
            if (buf == NULL) return NULL;
            continue;
        }
        break;
    }

    /* Finally concat the obtained string to the SDS string and return it. */
    t = sdscat(s, buf);
    if (buf != staticbuf) zfree(buf);
    return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x460, %rsp            # imm = 0x460
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x440(%rbp), %rax
movq %rax, -0x448(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1f4d0
shlq %rax
movq %rax, -0x458(%rbp)
cmpq $0x400, -0x458(%rbp) # imm = 0x400
jbe 0x2c9b1
movq -0x458(%rbp), %rdi
callq 0x2e130
movq %rax, -0x448(%rbp)
cmpq $0x0, -0x448(%rbp)
jne 0x2c9af
movq $0x0, -0x8(%rbp)
jmp 0x2cabf
jmp 0x2c9bc
movq $0x400, -0x458(%rbp) # imm = 0x400
jmp 0x2c9be
movq -0x448(%rbp), %rax
movq -0x458(%rbp), %rcx
subq $0x2, %rcx
movb $0x0, (%rax,%rcx)
leaq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x448(%rbp), %rdi
movq -0x458(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x1f7c0
movq -0x448(%rbp), %rax
movq -0x458(%rbp), %rcx
subq $0x2, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x2ca7c
movq -0x448(%rbp), %rax
leaq -0x440(%rbp), %rcx
cmpq %rcx, %rax
je 0x2ca3f
movq -0x448(%rbp), %rdi
callq 0x2e3a0
movq -0x458(%rbp), %rax
shlq %rax
movq %rax, -0x458(%rbp)
movq -0x458(%rbp), %rdi
callq 0x2e130
movq %rax, -0x448(%rbp)
cmpq $0x0, -0x448(%rbp)
jne 0x2ca77
movq $0x0, -0x8(%rbp)
jmp 0x2cabf
jmp 0x2c9be
jmp 0x2ca7e
movq -0x10(%rbp), %rdi
movq -0x448(%rbp), %rsi
callq 0x2c5b0
movq %rax, -0x450(%rbp)
movq -0x448(%rbp), %rax
leaq -0x440(%rbp), %rcx
cmpq %rcx, %rax
je 0x2cab4
movq -0x448(%rbp), %rdi
callq 0x2e3a0
movq -0x450(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x460, %rsp            # imm = 0x460
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdstrim
sds sdstrim(sds s, const char *cset) {
    struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));
    char *start, *end, *sp, *ep;
    size_t len;

    // 设置和记录指针
    sp = start = s;
    ep = end = s+sdslen(s)-1;

    // 修剪, T = O(N^2)
    while(sp <= end && strchr(cset, *sp)) sp++;
    while(ep > start && strchr(cset, *ep)) ep--;

    // 计算 trim 完毕之后剩余的字符串长度
    len = (sp > ep) ? 0 : ((ep-sp)+1);
    
    // 如果有需要，前移字符串内容
    // T = O(N)
    if (sh->buf != sp) memmove(sh->buf, sp, len);

    // 添加终结符
    sh->buf[len] = '\0';

    // 更新属性
    sh->free = sh->free+(sh->len-len);
    sh->len = len;

    // 返回修剪后的 sds
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2bfc0
movq %rax, %rcx
movq -0x48(%rbp), %rax
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x49(%rbp)
ja 0x2d1e8
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movsbl (%rax), %esi
callq 0x1f790
cmpq $0x0, %rax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x2d1f1
jmp 0x2d1ff
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2d1bf
jmp 0x2d201
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0x4a(%rbp)
jbe 0x2d22a
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movsbl (%rax), %esi
callq 0x1f790
cmpq $0x0, %rax
setne %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x2d233
jmp 0x2d241
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d201
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x2d253
xorl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0x2d266
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
cmpq -0x30(%rbp), %rax
je 0x2d291
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x1f780
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movb $0x0, 0x8(%rax,%rcx)
movq -0x18(%rbp), %rax
movslq 0x4(%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
subq -0x40(%rbp), %rcx
addq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdsrange
void sdsrange(sds s, int start, int end) {
    struct sdshdr *sh = (void*) (s-(sizeof(struct sdshdr)));
    size_t newlen, len = sdslen(s);

    if (len == 0) return;
    if (start < 0) {
        start = len+start;
        if (start < 0) start = 0;
    }
    if (end < 0) {
        end = len+end;
        if (end < 0) end = 0;
    }
    newlen = (start > end) ? 0 : (end-start)+1;
    if (newlen != 0) {
        if (start >= (signed)len) {
            newlen = 0;
        } else if (end >= (signed)len) {
            end = len-1;
            newlen = (start > end) ? 0 : (end-start)+1;
        }
    } else {
        start = 0;
    }

    // 如果有需要，对字符串进行移动
    // T = O(N)
    if (start && newlen) memmove(sh->buf, sh->buf+start, newlen);

    // 添加终结符
    sh->buf[newlen] = 0;

    // 更新属性
    sh->free = sh->free+(sh->len-newlen);
    sh->len = newlen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $-0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2bfc0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2d317
jmp 0x2d447
cmpl $0x0, -0xc(%rbp)
jge 0x2d33a
movq -0x28(%rbp), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x2d338
movl $0x0, -0xc(%rbp)
jmp 0x2d33a
cmpl $0x0, -0x10(%rbp)
jge 0x2d35d
movq -0x28(%rbp), %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x2d35b
movl $0x0, -0x10(%rbp)
jmp 0x2d35d
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x2d36c
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2d378
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cltq
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2d3db
movl -0xc(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl %ecx, %eax
jl 0x2d39d
movq $0x0, -0x20(%rbp)
jmp 0x2d3d9
movl -0x10(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl %ecx, %eax
jl 0x2d3d7
movq -0x28(%rbp), %rax
subq $0x1, %rax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x2d3c2
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0x2d3ce
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cltq
movq %rax, -0x20(%rbp)
jmp 0x2d3d9
jmp 0x2d3e2
movl $0x0, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x2d40f
cmpq $0x0, -0x20(%rbp)
je 0x2d40f
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movslq -0xc(%rbp), %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
callq 0x1f780
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x0, 0x8(%rax,%rcx)
movq -0x18(%rbp), %rax
movslq 0x4(%rax), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
subq -0x20(%rbp), %rcx
addq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/sds.c
// Function: sdsfreesplitres
void sdsfreesplitres(sds *tokens, int count) {
    if (!tokens) return;
    while(count--)
        sdsfree(tokens[count]);
    zfree(tokens);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x2d7e8
jmp 0x2d816
jmp 0x2d7ea
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, %eax
je 0x2d80d
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2c160
jmp 0x2d7ea
movq -0x8(%rbp), %rdi
callq 0x2e3a0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/zmalloc.c
// Function: zmalloc_get_private_dirty
size_t zmalloc_get_private_dirty(void) {
    char line[1024];
    size_t pd = 0;
    FILE *fp = fopen("/proc/self/smaps","r");

    if (!fp) return 0;
    while(fgets(line,sizeof(line),fp) != NULL) {
        if (strncmp(line,"Private_Dirty:",14) == 0) {
            char *p = strchr(line,'k');
            if (p) {
                *p = '\0';
                pd += strtol(line+14,NULL,10) * 1024;
            }
        }
    }
    fclose(fp);
    return pd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq $0x0, -0x418(%rbp)
leaq 0xb2586(%rip), %rdi     # 0xe0cf3
leaq 0xb255f(%rip), %rsi     # 0xe0cd3
callq 0x1f360
movq %rax, -0x420(%rbp)
cmpq $0x0, -0x420(%rbp)
jne 0x2e797
movq $0x0, -0x8(%rbp)
jmp 0x2e849
jmp 0x2e799
leaq -0x410(%rbp), %rdi
movq -0x420(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x1f430
cmpq $0x0, %rax
je 0x2e832
leaq -0x410(%rbp), %rdi
leaq 0xb253f(%rip), %rsi     # 0xe0d04
movl $0xe, %edx
callq 0x1f340
cmpl $0x0, %eax
jne 0x2e82d
leaq -0x410(%rbp), %rdi
movl $0x6b, %esi
callq 0x1f790
movq %rax, -0x428(%rbp)
cmpq $0x0, -0x428(%rbp)
je 0x2e82b
movq -0x428(%rbp), %rax
movb $0x0, (%rax)
leaq -0x410(%rbp), %rdi
addq $0xe, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x1f6c0
shlq $0xa, %rax
addq -0x418(%rbp), %rax
movq %rax, -0x418(%rbp)
jmp 0x2e82d
jmp 0x2e799
movq -0x420(%rbp), %rdi
callq 0x1f9b0
movq -0x418(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/zipmap.c
// Function: zipmapRequiredLength
static unsigned long zipmapRequiredLength(unsigned int klen, unsigned int vlen) {
    unsigned int l;

    // 节点的基本长度要求：
    // 1) klen : 键的长度
    // 2) vlen : 值的长度
    // 3) 两个字符串都需要至少 1 字节来保存长度，而 <free> 也需要 1 个字节，共 3 字节
    l = klen+vlen+3;

    // 如果 1 字节不足以编码键的长度，那么需要多 4 个字节
    if (klen >= ZIPMAP_BIGLEN) l += 4;

    // 如果 1 字节不足以编码值的长度，那么需要多 4 个字节
    if (vlen >= ZIPMAP_BIGLEN) l += 4;

    return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
addl -0x8(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xc(%rbp)
cmpl $0xfe, -0x4(%rbp)
jb 0x30218
movl -0xc(%rbp), %eax
addl $0x4, %eax
movl %eax, -0xc(%rbp)
cmpl $0xfe, -0x8(%rbp)
jb 0x3022a
movl -0xc(%rbp), %eax
addl $0x4, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x30230
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x30762
movl $0x0, -0x4(%rbp)
jmp 0x307be
movq -0x38(%rbp), %rdi
callq 0x306a0
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x30660
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movl (%rax), %esi
movl $0x5, %eax
movl $0x1, %edx
cmpl $0xfe, %esi
cmovbq %rdx, %rax
addq %rax, %rcx
addq $0x1, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xfe, %eax
jge 0x3083d
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0x3088c
movq -0x8(%rbp), %rdi
callq 0x30530
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rsi
movq %r8, %rdx
movq %r8, %rcx
callq 0x30550
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x30876
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3084a
cmpl $0xfe, -0xc(%rbp)
jae 0x3088a
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
jmp 0x3088c
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
shll $0x3, %eax
movq -0x8(%rbp), %rcx
addl 0x14(%rcx), %eax
movl %eax, 0x14(%rcx)
cmpl -0x1c(%rbp), %eax
jae 0x327bf
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
movl -0x14(%rbp), %ecx
shrl $0x1d, %ecx
movq -0x8(%rbp), %rax
addl 0x18(%rax), %ecx
movl %ecx, 0x18(%rax)
movl -0x1c(%rbp), %eax
shrl $0x3, %eax
andl $0x3f, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl -0x14(%rbp), %eax
cmpl $0x3f, %eax
jbe 0x3284f
movq -0x8(%rbp), %rdi
addq $0x1c, %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl $0x40, %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
movl %eax, %eax
movl %eax, %edx
callq 0x1fbf0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x1c, %rsi
callq 0x308d0
movl -0x18(%rbp), %eax
addl $0x3f, %eax
cmpl -0x14(%rbp), %eax
jae 0x32846
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %eax
addq %rax, %rsi
callq 0x308d0
movl -0x18(%rbp), %eax
addl $0x40, %eax
movl %eax, -0x18(%rbp)
jmp 0x3281d
movl $0x0, -0x1c(%rbp)
jmp 0x32856
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x1c, %rdi
movl -0x1c(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x18(%rbp), %eax
addq %rax, %rsi
movl -0x14(%rbp), %eax
subl -0x18(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
callq 0x1fbf0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x32a8a
movq -0x8(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x28(%rbp)
jmp 0x32a9f
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
callq 0x32ad0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x32f3a
xorl %eax, %eax
subl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0x32f38
movq -0x18(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x32fd0
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x34(%rbp)
movb %al, -0x79(%rbp)
jbe 0x32ee7
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x79(%rbp)
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x32ef0
jmp 0x32f36
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x32fd0
movq -0x78(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x32ec8
jmp 0x32f38
jmp 0x32f93
movq -0x8(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0xff, %ecx
movb %al, -0x7a(%rbp)
je 0x32f6e
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x7a(%rbp)
movb -0x7a(%rbp), %al
testb $0x1, %al
jne 0x32f77
jmp 0x32f91
movq -0x18(%rbp), %rdi
callq 0x331c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x32f46
jmp 0x32f93
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0x32fa7
cmpl $0x0, -0xc(%rbp)
jle 0x32fb2
xorl %eax, %eax
movq %rax, -0x88(%rbp)
jmp 0x32fbd
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xfe, %eax
jge 0x331e3
movl $0x1, -0xc(%rbp)
jmp 0x331ea
movl $0x5, -0xc(%rbp)
jmp 0x331ec
jmp 0x331ee
jmp 0x331f0
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x10(%rbp)
cmpl $0xc0, -0x10(%rbp)
jae 0x33212
movl -0x10(%rbp), %eax
andl $0xc0, %eax
movl %eax, -0x10(%rbp)
jmp 0x33214
cmpl $0xc0, -0x10(%rbp)
jae 0x33300
cmpl $0x0, -0x10(%rbp)
jne 0x33244
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x3f, %eax
movl %eax, -0x18(%rbp)
jmp 0x332fe
cmpl $0x40, -0x10(%rbp)
jne 0x33278
movl $0x2, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x3f, %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
movzbl 0x1(%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x18(%rbp)
jmp 0x332fc
cmpl $0x80, -0x10(%rbp)
jne 0x332cc
movl $0x5, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movzbl 0x1(%rax,%rcx), %eax
shll $0x18, %eax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
movzbl 0x2(%rcx,%rdx), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
movzbl 0x3(%rcx,%rdx), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
movzbl 0x4(%rcx,%rdx), %ecx
orl %ecx, %eax
movl %eax, -0x18(%rbp)
jmp 0x332fa
xorl %eax, %eax
testb $0x1, %al
jne 0x332d4
jmp 0x332d6
jmp 0x332f8
leaq 0xb00ae(%rip), %rdi     # 0xe338b
leaq 0xada79(%rip), %rsi     # 0xe0d5d
movl $0x253, %edx            # imm = 0x253
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
jmp 0x332fa
jmp 0x332fc
jmp 0x332fe
jmp 0x33315
movl $0x1, -0x14(%rbp)
movl -0x10(%rbp), %eax
movzbl %al, %edi
callq 0x33ee0
movl %eax, -0x18(%rbp)
jmp 0x33317
movl -0xc(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x333fb
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x333e6
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x333ee
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x33482
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0xa, %rcx
cmpq %rcx, %rax
jne 0x33416
movq $0x0, -0x8(%rbp)
jmp 0x33482
movq -0x18(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x32fd0
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x34(%rbp)
jbe 0x3344b
jmp 0x3346d
leaq 0xad8f6(%rip), %rdi     # 0xe0d48
leaq 0xad904(%rip), %rsi     # 0xe0d5d
movl $0x55c, %edx            # imm = 0x55C
callq 0x63ca0
movl $0x1, %edi
callq 0x1f3b0
movq -0x18(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x334bd
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x334c9
movl $0x0, -0x4(%rbp)
jmp 0x33568
cmpq $0x0, -0x18(%rbp)
je 0x334db
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x32fd0
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movzbl -0x34(%rbp), %eax
andl $0xc0, %eax
cmpl $0xc0, %eax
jge 0x3353b
cmpq $0x0, -0x18(%rbp)
je 0x33539
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movl -0x38(%rbp), %eax
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x33561
cmpq $0x0, -0x28(%rbp)
je 0x3355f
movq -0x10(%rbp), %rdi
movl -0x38(%rbp), %eax
addq %rax, %rdi
movzbl -0x34(%rbp), %esi
callq 0x33580
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x33561
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: ziplistDeleteRange
unsigned char *ziplistDeleteRange(unsigned char *zl, unsigned int index, unsigned int num) {

    // 根据索引定位到节点
    // T = O(N)
    unsigned char *p = ziplistIndex(zl,index);

    // 连续删除 num 个节点
    // T = O(N^2)
    return (p == NULL) ? zl : __ziplistDelete(zl,p,num);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x32e50
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x339f3
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x33a07
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x10(%rbp), %edx
callq 0x33760
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/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:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x33a50
movl $0x0, -0x4(%rbp)
jmp 0x33b14
movq -0x10(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x32fd0
movq -0x78(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x28(%rbp)
movzbl -0x2c(%rbp), %eax
andl $0xc0, %eax
cmpl $0xc0, %eax
jge 0x33ac6
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x33abd
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x1f950
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x33b14
movl $0x0, -0x4(%rbp)
jmp 0x33b14
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x58(%rbp), %rdx
leaq -0x41(%rbp), %rcx
callq 0x33b20
cmpl $0x0, %eax
je 0x33b0b
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movzbl -0x2c(%rbp), %esi
callq 0x33580
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x33b14
jmp 0x33b0d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
jge 0x33f9f
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0x33ff5
movq -0x8(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0x33fdc
movq -0x18(%rbp), %rdi
callq 0x331c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x33fab
cmpl $0xffff, -0xc(%rbp)     # imm = 0xFFFF
jae 0x33ff3
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0x33ff5
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/ziplist.c
// Function: zipPrevEncodeLength
static unsigned int zipPrevEncodeLength(unsigned char *p, unsigned int len) {

    // 仅返回编码 len 所需的字节数量
    if (p == NULL) {
        return (len < ZIP_BIGLEN) ? 1 : sizeof(len)+1;

    // 写入并返回编码 len 所需的字节数量
    } else {

        // 1 字节
        if (len < ZIP_BIGLEN) {
            p[0] = len;
            return 1;

        // 5 字节
        } else {
            // 添加 5 字节长度标识
            p[0] = ZIP_BIGLEN;
            // 写入编码
            memcpy(p+1,&len,sizeof(len));
            // 如果有必要的话，进行大小端转换
            memrev32ifbe(p+1);
            // 返回编码长度
            return 1+sizeof(len);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3420e
movl -0x14(%rbp), %edx
movl $0x5, %eax
movl $0x1, %ecx
cmpl $0xfe, %edx
cmovbq %rcx, %rax
movl %eax, -0x4(%rbp)
jmp 0x34243
cmpl $0xfe, -0x14(%rbp)
jae 0x3422b
movl -0x14(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x34243
movq -0x10(%rbp), %rax
movb $-0x2, (%rax)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x1(%rax)
movl $0x5, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)