LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/db.c
// Function: getKeysUsingCommandTable
int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, int *numkeys) {
    int j, i = 0, last, *keys;
    UNUSED(argv);

    if (cmd->firstkey == 0) {
        *numkeys = 0;
        return NULL;
    }
    last = cmd->lastkey;
    if (last < 0) last = argc+last;
    keys = zmalloc(sizeof(int)*((last - cmd->firstkey)+1));
    for (j = cmd->firstkey; j <= last; j += cmd->keystep) {
        serverAssert(j < argc);
        keys[i++] = j;
    }
    *numkeys = i;
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl 0x30(%rdi), %eax
xorl %r15d, %r15d
testl %eax, %eax
je 0x46b94
movl %edx, %ebp
movq %rdi, %r14
movl 0x34(%rdi), %ecx
movl %ecx, %r12d
sarl $0x1f, %r12d
andl %edx, %r12d
addl %ecx, %r12d
movl %r12d, %ecx
subl %eax, %ecx
incl %ecx
movslq %ecx, %rdi
shlq $0x2, %rdi
callq 0x3b29d
movl 0x30(%r14), %ecx
cmpl %r12d, %ecx
jg 0x46b96
xorl %r15d, %r15d
cmpl %ebp, %ecx
jge 0x46ba2
movl %ecx, (%rax,%r15,4)
incq %r15
addl 0x38(%r14), %ecx
cmpl %r12d, %ecx
jle 0x46b7e
jmp 0x46b96
xorl %eax, %eax
movl %r15d, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7d4e7(%rip), %rdi     # 0xc4090
leaq 0x7eddf(%rip), %rsi     # 0xc598f
movl $0x435, %edx            # imm = 0x435
callq 0x654e1
movl $0x1, %edi
callq 0x263d0
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/db.c
// Function: migrateGetKeys
int *migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, first, *keys;
    UNUSED(cmd);

    /* Assume the obvious form. */
    first = 3;
    num = 1;

    /* But check for the extended one with the KEYS option. */
    if (argc > 6) {
        for (i = 6; i < argc; i++) {
            if (!strcasecmp(argv[i]->ptr,"keys") &&
                sdslen(argv[3]->ptr) == 0)
            {
                first = i+1;
                num = argc-first;
                break;
            }
        }
    }

    keys = zmalloc(sizeof(int)*num);
    for (i = 0; i < num; i++) keys[i] = first+i;
    *numkeys = num;
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movl $0x3, %ebx
movl $0x1, %ebp
cmpl $0x7, %edx
jl 0x46e81
movq %rsi, %r14
movq %r15, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %edx, %r12d
addq $-0x6, %r12
xorl %r13d, %r13d
leaq 0x84d29(%rip), %r15     # 0xcbb21
leaq 0x7d0a5(%rip), %rbp     # 0xc3ea4
movq 0x30(%r14,%r13,8), %rax
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x26300
testl %eax, %eax
jne 0x46e57
movq 0x18(%r14), %rax
movq 0x8(%rax), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x46e50
movslq (%rbp,%rdx,4), %rdx
addq %rbp, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x46e52
movq -0x11(%rcx), %rax
jmp 0x46e52
movzwl -0x5(%rcx), %eax
jmp 0x46e52
movl -0x9(%rcx), %eax
jmp 0x46e52
movzbl -0x3(%rcx), %eax
jmp 0x46e52
xorl %eax, %eax
testq %rax, %rax
je 0x46e6b
incq %r13
cmpq %r13, %r12
jne 0x46dff
movq 0x10(%rsp), %r15
movl $0x1, %ebp
jmp 0x46e81
movl 0xc(%rsp), %ebp
subl %r13d, %ebp
addl $-0x7, %ebp
addq $0x7, %r13
movq %r13, %rbx
movq 0x10(%rsp), %r15
movslq %ebp, %r14
leaq (,%r14,4), %rdi
callq 0x3b29d
testl %r14d, %r14d
jle 0x46ea8
movl %ebp, %ecx
xorl %edx, %edx
leal (%rbx,%rdx), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x46e9a
movl %ebp, (%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationGetSlaveName
char *replicationGetSlaveName(client *c) {
    static char buf[NET_PEER_ID_LEN];
    char ip[NET_IP_STR_LEN];

    ip[0] = '\0';
    buf[0] = '\0';
    if (c->slave_ip[0] != '\0' ||
        anetPeerToString(c->fd,ip,sizeof(ip),NULL) != -1)
    {
        /* Note that the 'ip' buffer is always larger than 'c->slave_ip' */
        if (c->slave_ip[0] != '\0') memcpy(ip,c->slave_ip,sizeof(c->slave_ip));

        if (c->slave_listening_port)
            anetFormatAddr(buf,sizeof(buf),ip,c->slave_listening_port);
        else
            snprintf(buf,sizeof(buf),"%s:<unknown-slave-port>",ip);
    } else {
        snprintf(buf,sizeof(buf),"client id #%llu",
            (unsigned long long) c->id);
    }
    return buf;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movb %al, (%rsp)
movb %al, 0xd4069(%rip)      # 0x11b100
cmpb %al, 0x118(%rdi)
jne 0x470b6
movl 0x8(%rbx), %edi
movq %rsp, %rsi
movl $0x2e, %edx
xorl %ecx, %ecx
callq 0x31360
cmpl $-0x1, %eax
je 0x47107
leaq 0x118(%rbx), %rax
cmpb $0x0, (%rax)
je 0x470db
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x1e(%rax), %xmm2
movups %xmm2, 0x1e(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl 0x114(%rbx), %ecx
leaq 0xd4018(%rip), %rdi     # 0x11b100
testl %ecx, %ecx
je 0x470fb
movq %rsp, %rdx
movl $0x4e, %esi
callq 0x3144a
jmp 0x47124
leaq 0x7d062(%rip), %rdx     # 0xc4164
movq %rsp, %rcx
jmp 0x47118
movq (%rbx), %rcx
leaq 0xd3fef(%rip), %rdi     # 0x11b100
leaq 0x7d064(%rip), %rdx     # 0xc417c
movl $0x4e, %esi
xorl %eax, %eax
callq 0x26120
leaq 0xd3fd5(%rip), %rax     # 0x11b100
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: createReplicationBacklog
void createReplicationBacklog(void) {
    serverAssert(server.repl_backlog == NULL);
    server.repl_backlog = zmalloc(server.repl_backlog_size);
    server.repl_backlog_histlen = 0;
    server.repl_backlog_idx = 0;
    /* When a new backlog buffer is created, we increment the replication
     * offset by one to make sure we'll not be able to PSYNC with any
     * previous slave. This is needed because we avoid incrementing the
     * master_repl_offset if no backlog exists nor slaves are attached. */
    server.master_repl_offset++;

    /* We don't have any data inside our buffer, but virtually the first
     * byte we have is the next byte that will be generated for the
     * replication stream. */
    server.repl_backlog_off = server.master_repl_offset+1;
}

// Assembly:
pushq %rbx
leaq 0xbf71f(%rip), %rbx     # 0x106858
cmpq $0x0, 0x7c0(%rbx)
jne 0x4717f
movq 0x7c8(%rbx), %rdi
callq 0x3b29d
movq %rax, 0x7c0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7d0(%rbx)
movq 0x7b0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x7b0(%rbx)
addq $0x2, %rax
movq %rax, 0x7e0(%rbx)
popq %rbx
retq
leaq 0x7d006(%rip), %rdi     # 0xc418c
leaq 0x7d01b(%rip), %rsi     # 0xc41a8
movl $0x4e, %edx
callq 0x654e1
movl $0x1, %edi
callq 0x263d0
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: resizeReplicationBacklog
void resizeReplicationBacklog(long long newsize) {
    if (newsize < CONFIG_REPL_BACKLOG_MIN_SIZE)
        newsize = CONFIG_REPL_BACKLOG_MIN_SIZE;
    if (server.repl_backlog_size == newsize) return;

    server.repl_backlog_size = newsize;
    if (server.repl_backlog != NULL) {
        /* What we actually do is to flush the old buffer and realloc a new
         * empty one. It will refill with new data incrementally.
         * The reason is that copying a few gigabytes adds latency and even
         * worse often we need to alloc additional space before freeing the
         * old buffer. */
        zfree(server.repl_backlog);
        server.repl_backlog = zmalloc(server.repl_backlog_size);
        server.repl_backlog_histlen = 0;
        server.repl_backlog_idx = 0;
        /* Next byte we have is... the next since the buffer is empty. */
        server.repl_backlog_off = server.master_repl_offset+1;
    }
}

// Assembly:
pushq %rbx
cmpq $0x4001, %rdi           # imm = 0x4001
movl $0x4000, %eax           # imm = 0x4000
cmovgeq %rdi, %rax
leaq 0xbf69f(%rip), %rbx     # 0x106858
cmpq %rax, 0x7c8(%rbx)
je 0x47208
movq %rax, 0x7c8(%rbx)
movq 0x7c0(%rbx), %rdi
testq %rdi, %rdi
je 0x47208
callq 0x3b3df
movq 0x7c8(%rbx), %rdi
callq 0x3b29d
movq %rax, 0x7c0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7d0(%rbx)
movq 0x7b0(%rbx), %rax
incq %rax
movq %rax, 0x7e0(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: feedReplicationBacklog
void feedReplicationBacklog(void *ptr, size_t len) {
    unsigned char *p = ptr;

    server.master_repl_offset += len;

    /* This is a circular buffer, so write as much data we can at every
     * iteration and rewind the "idx" index if we reach the limit. */
    while(len) {
        size_t thislen = server.repl_backlog_size - server.repl_backlog_idx;
        if (thislen > len) thislen = len;
        memcpy(server.repl_backlog+server.repl_backlog_idx,p,thislen);
        server.repl_backlog_idx += thislen;
        if (server.repl_backlog_idx == server.repl_backlog_size)
            server.repl_backlog_idx = 0;
        len -= thislen;
        p += thislen;
        server.repl_backlog_histlen += thislen;
    }
    if (server.repl_backlog_histlen > server.repl_backlog_size)
        server.repl_backlog_histlen = server.repl_backlog_size;
    /* Set the offset of the first byte we have in the backlog. */
    server.repl_backlog_off = server.master_repl_offset -
                              server.repl_backlog_histlen + 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0xbf5ed(%rip), %r12     # 0x106858
addq %rsi, 0x7b0(%r12)
testq %rsi, %rsi
je 0x472dd
movq %rsi, %rbx
movq %rdi, %r14
xorl %r13d, %r13d
movq 0x7c8(%r12), %r15
movq 0x7d8(%r12), %rdi
subq %rdi, %r15
cmpq %rbx, %r15
cmovaeq %rbx, %r15
addq 0x7c0(%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x26c60
movq 0x7d8(%r12), %rax
addq %r15, %rax
cmpq 0x7c8(%r12), %rax
cmoveq %r13, %rax
movq %rax, 0x7d8(%r12)
addq %r15, %r14
addq %r15, 0x7d0(%r12)
subq %r15, %rbx
jne 0x47281
movq 0x7c8(%r12), %rax
cmpq %rax, 0x7d0(%r12)
jle 0x472f7
movq %rax, 0x7d0(%r12)
movq 0x7b0(%r12), %rax
subq 0x7d0(%r12), %rax
incq %rax
movq %rax, 0x7e0(%r12)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: feedReplicationBacklogWithObject
void feedReplicationBacklogWithObject(robj *o) {
    char llstr[LONG_STR_SIZE];
    void *p;
    size_t len;

    if (o->encoding == OBJ_ENCODING_INT) {
        len = ll2string(llstr,sizeof(llstr),(long)o->ptr);
        p = llstr;
    } else {
        len = sdslen(o->ptr);
        p = o->ptr;
    }
    feedReplicationBacklog(p,len);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl $0xf0, %eax
andl (%rdi), %eax
movq 0x8(%rdi), %rdx
cmpl $0x10, %eax
jne 0x47355
movq %rsp, %rbx
movl $0x15, %esi
movq %rbx, %rdi
callq 0x433e5
movslq %eax, %rsi
movq %rbx, %rdx
movq %rdx, %rdi
callq 0x4725b
addq $0x20, %rsp
popq %rbx
retq
movzbl -0x1(%rdx), %esi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x4738f
leaq 0x7cd32(%rip), %rcx     # 0xc409c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x47347
movq -0x11(%rdx), %rsi
jmp 0x47347
movzwl -0x5(%rdx), %esi
jmp 0x47347
movl -0x9(%rdx), %esi
jmp 0x47347
movzbl -0x3(%rdx), %esi
jmp 0x47347
xorl %esi, %esi
jmp 0x47347
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationSetupSlaveForFullResync
int replicationSetupSlaveForFullResync(client *slave, long long offset) {
    char buf[128];
    int buflen;

    slave->psync_initial_offset = offset;
    slave->replstate = SLAVE_STATE_WAIT_BGSAVE_END;
    /* We are going to accumulate the incremental changes for this
     * slave as well. Set slaveseldb to -1 in order to force to re-emit
     * a SLEECT statement in the replication stream. */
    server.slaveseldb = -1;

    /* Don't send this reply to slaves that approached us with
     * the old SYNC command. */
    if (!(slave->flags & CLIENT_PRE_PSYNC)) {
        buflen = snprintf(buf,sizeof(buf),"+FULLRESYNC %s %lld\r\n",
                          server.runid,offset);
        if (write(slave->fd,buf,buflen) != buflen) {
            freeClientAsync(slave);
            return C_ERR;
        }
    }
    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0xe0(%rdi)
movl $0x7, 0xa0(%rdi)
leaq 0xbee8f(%rip), %rcx     # 0x106858
movl $0xffffffff, 0x7ac(%rcx) # imm = 0xFFFFFFFF
xorl %ebp, %ebp
testb $0x1, 0x9a(%rdi)
jne 0x47a26
movq %rsi, %r8
movq %rdi, %rbx
addq $0x70, %rcx
leaq 0x7c97d(%rip), %rdx     # 0xc436c
xorl %ebp, %ebp
movq %rsp, %r14
movl $0x80, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x26120
movl 0x8(%rbx), %edi
movslq %eax, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x26bc0
cmpq %r15, %rax
je 0x47a26
movq %rbx, %rdi
callq 0x40ebf
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: refreshGoodSlavesCount
void refreshGoodSlavesCount(void) {
    listIter li;
    listNode *ln;
    int good = 0;

    if (!server.repl_min_slaves_to_write ||
        !server.repl_min_slaves_max_lag) return;

    listRewind(server.slaves,&li);
    while((ln = listNext(&li))) {
        client *slave = ln->value;
        time_t lag = server.unixtime - slave->repl_ack_time;

        if (slave->replstate == SLAVE_STATE_ONLINE &&
            lag <= server.repl_min_slaves_max_lag) good++;
    }
    server.repl_good_slaves_count = good;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xbec12(%rip), %r14     # 0x106858
cmpl $0x0, 0x7f8(%r14)
je 0x47cbe
cmpl $0x0, 0x7fc(%r14)
je 0x47cbe
movq 0x1e0(%r14), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x2e582
movq %rbx, %rdi
callq 0x2e59f
xorl %ebp, %ebp
testq %rax, %rax
je 0x47cb7
movq %rsp, %rbx
movq 0x10(%rax), %rax
cmpl $0x9, 0xa0(%rax)
jne 0x47caa
movq 0x968(%r14), %rcx
subq 0xd8(%rax), %rcx
movslq 0x7fc(%r14), %rax
xorl %edx, %edx
cmpq %rax, %rcx
setle %dl
addl %edx, %ebp
movq %rbx, %rdi
callq 0x2e59f
testq %rax, %rax
jne 0x47c7e
movl %ebp, 0x800(%r14)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: putSlaveOnline
void putSlaveOnline(client *slave) {
    slave->replstate = SLAVE_STATE_ONLINE;
    slave->repl_put_online_on_ack = 0;
    slave->repl_ack_time = server.unixtime; /* Prevent false timeout. */
    if (aeCreateFileEvent(server.el, slave->fd, AE_WRITABLE,
        sendReplyToClient, slave) == AE_ERR) {
        serverLog(LL_WARNING,"Unable to register writable event for slave bulk transfer: %s", strerror(errno));
        freeClient(slave);
        return;
    }
    refreshGoodSlavesCount();
    serverLog(LL_NOTICE,"Synchronization with slave %s succeeded",
        replicationGetSlaveName(slave));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x9, 0xa0(%rdi)
leaq 0xbe44d(%rip), %rax     # 0x106858
movq 0x968(%rax), %rcx
movq %rcx, 0xd8(%rdi)
movq 0x40(%rax), %rdi
movl 0x8(%rbx), %esi
leaq -0x7286(%rip), %rcx     # 0x411a1
movl $0x2, %edx
movq %rbx, %r8
callq 0x2fee7
cmpl $-0x1, %eax
je 0x48461
callq 0x47c37
movq %rbx, %rdi
callq 0x47084
leaq 0x7c3dc(%rip), %rsi     # 0xc4829
leaq 0xd2cac(%rip), %rdx     # 0x11b100
movl $0x2, %edi
xorl %eax, %eax
popq %rbx
jmp 0x32ea6
callq 0x26890
movl (%rax), %edi
callq 0x26690
leaq 0x7c377(%rip), %rsi     # 0xc47eb
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x32ea6
movq %rbx, %rdi
popq %rbx
jmp 0x40b04
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationSendAck
void replicationSendAck(void) {
    client *c = server.master;

    if (c != NULL) {
        c->flags |= CLIENT_MASTER_FORCE_REPLY;
        addReplyMultiBulkLen(c,3);
        addReplyBulkCString(c,"REPLCONF");
        addReplyBulkCString(c,"ACK");
        addReplyBulkLongLong(c,c->reploff);
        c->flags &= ~CLIENT_MASTER_FORCE_REPLY;
    }
}

// Assembly:
pushq %rbx
leaq 0xbe3c4(%rip), %rax     # 0x106858
movq 0x828(%rax), %rbx
testq %rbx, %rbx
je 0x484e8
orb $0x20, 0x99(%rbx)
movl $0x3, %esi
movq %rbx, %rdi
callq 0x4063b
leaq 0x776be(%rip), %rsi     # 0xbfb79
movq %rbx, %rdi
callq 0x404b9
leaq 0x776bb(%rip), %rsi     # 0xbfb85
movq %rbx, %rdi
callq 0x404b9
movq 0xc8(%rbx), %rsi
movq %rbx, %rdi
callq 0x407de
andb $-0x21, 0x99(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationCreateMasterClient
void replicationCreateMasterClient(int fd) {
    server.master = createClient(fd);
    server.master->flags |= CLIENT_MASTER;
    server.master->authenticated = 1;
    server.repl_state = REPL_STATE_CONNECTED;
    server.master->reploff = server.repl_master_initial_offset;
    memcpy(server.master->replrunid, server.repl_master_runid,
        sizeof(server.repl_master_runid));
    /* If master offset is set to -1, this master is old and is not
     * PSYNC capable, so we flag it accordingly. */
    if (server.master->reploff == -1)
        server.master->flags |= CLIENT_PRE_PSYNC;
}

// Assembly:
pushq %rax
callq 0x3f180
leaq 0xbdecc(%rip), %rcx     # 0x106858
movq %rax, 0x828(%rcx)
orb $0x2, 0x98(%rax)
movl $0x1, 0x9c(%rax)
movl $0xf, 0x83c(%rcx)
movq 0x8c8(%rcx), %rdx
movq %rdx, 0xc8(%rax)
movups 0x898(%rcx), %xmm0
movups 0x8a8(%rcx), %xmm1
movups 0x8b1(%rcx), %xmm2
movups %xmm2, 0x101(%rax)
movups %xmm1, 0xf8(%rax)
movups %xmm0, 0xe8(%rax)
movq 0x828(%rcx), %rax
cmpq $-0x1, 0xc8(%rax)
jne 0x489fe
orb $0x1, 0x9a(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: cancelReplicationHandshake
int cancelReplicationHandshake(void) {
    if (server.repl_state == REPL_STATE_TRANSFER) {
        replicationAbortSyncTransfer();
        server.repl_state = REPL_STATE_CONNECT;
    } else if (server.repl_state == REPL_STATE_CONNECTING ||
               slaveIsInHandshakeState())
    {
        undoConnectWithMaster();
        server.repl_state = REPL_STATE_CONNECT;
    } else {
        return 0;
    }
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xbd92e(%rip), %r14     # 0x106858
movl 0x83c(%r14), %ecx
cmpl $0x2, %ecx
je 0x48f4c
cmpl $0xe, %ecx
jne 0x48f42
callq 0x49e68
jmp 0x48f75
addl $-0xe, %ecx
xorl %eax, %eax
cmpl $-0xb, %ecx
jb 0x48f85
movl 0x858(%r14), %ebx
movq 0x40(%r14), %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2ffb6
movl %ebx, %edi
callq 0x26180
movl $0xffffffff, 0x858(%r14) # imm = 0xFFFFFFFF
movl $0x1, 0x83c(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationDiscardCachedMaster
void replicationDiscardCachedMaster(void) {
    if (server.cached_master == NULL) return;

    serverLog(LL_NOTICE,"Discarding previously cached master state.");
    server.cached_master->flags &= ~CLIENT_MASTER;
    freeClient(server.cached_master);
    server.cached_master = NULL;
}

// Assembly:
pushq %rbx
leaq 0xbd310(%rip), %rbx     # 0x106858
cmpq $0x0, 0x830(%rbx)
je 0x49583
leaq 0x7bfa6(%rip), %rsi     # 0xc54ff
movl $0x2, %edi
xorl %eax, %eax
callq 0x32ea6
movq 0x830(%rbx), %rdi
andl $-0x3, 0x98(%rdi)
callq 0x40b04
movq $0x0, 0x830(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationResurrectCachedMaster
void replicationResurrectCachedMaster(int newfd) {
    server.master = server.cached_master;
    server.cached_master = NULL;
    server.master->fd = newfd;
    server.master->flags &= ~(CLIENT_CLOSE_AFTER_REPLY|CLIENT_CLOSE_ASAP);
    server.master->authenticated = 1;
    server.master->lastinteraction = server.unixtime;
    server.repl_state = REPL_STATE_CONNECTED;

    /* Re-add to the list of clients. */
    listAddNodeTail(server.clients,server.master);
    if (aeCreateFileEvent(server.el, newfd, AE_READABLE,
                          readQueryFromClient, server.master)) {
        serverLog(LL_WARNING,"Error resurrecting the cached master, impossible to add the readable handler: %s", strerror(errno));
        freeClientAsync(server.master); /* Close ASAP. */
    }

    /* We may also need to install the write handler as well if there is
     * pending data in the write buffers. */
    if (clientHasPendingReplies(server.master)) {
        if (aeCreateFileEvent(server.el, newfd, AE_WRITABLE,
                          sendReplyToClient, server.master)) {
            serverLog(LL_WARNING,"Error resurrecting the cached master, impossible to add the writable handler: %s", strerror(errno));
            freeClientAsync(server.master); /* Close ASAP. */
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0xbd2c6(%rip), %r14     # 0x106858
movq 0x830(%r14), %rsi
movq %rsi, 0x828(%r14)
movq $0x0, 0x830(%r14)
movl %edi, 0x8(%rsi)
andl $0xfffffbbf, 0x98(%rsi) # imm = 0xFFFFFBBF
movl $0x1, 0x9c(%rsi)
movq 0x968(%r14), %rax
movq %rax, 0x88(%rsi)
movl $0xf, 0x83c(%r14)
movq 0x1c8(%r14), %rdi
callq 0x2e40f
movq 0x40(%r14), %rdi
movq 0x828(%r14), %r8
leaq -0xa276(%rip), %rcx     # 0x3f383
movl %ebx, %esi
movl $0x1, %edx
callq 0x2fee7
testl %eax, %eax
je 0x49637
callq 0x26890
movl (%rax), %edi
callq 0x26690
leaq 0x7bf0e(%rip), %rsi     # 0xc552a
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x32ea6
movq 0x828(%r14), %rdi
callq 0x40ebf
movq 0x828(%r14), %rdi
callq 0x3f665
testl %eax, %eax
je 0x4969e
movq 0x40(%r14), %rdi
movq 0x828(%r14), %r8
leaq -0x84b8(%rip), %rcx     # 0x411a1
movl %ebx, %esi
movl $0x2, %edx
callq 0x2fee7
testl %eax, %eax
je 0x4969e
callq 0x26890
movl (%rax), %edi
callq 0x26690
leaq 0x7beff(%rip), %rsi     # 0xc557b
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x32ea6
movq 0x828(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x40ebf
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: connectWithMaster
int connectWithMaster(void) {
    int fd;

    fd = anetTcpNonBlockBestEffortBindConnect(NULL,
        server.masterhost,server.masterport,NET_FIRST_BIND_ADDR);
    if (fd == -1) {
        serverLog(LL_WARNING,"Unable to connect to MASTER: %s",
            strerror(errno));
        return C_ERR;
    }

    if (aeCreateFileEvent(server.el,fd,AE_READABLE|AE_WRITABLE,syncWithMaster,NULL) ==
            AE_ERR)
    {
        close(fd);
        serverLog(LL_WARNING,"Can't create readable event for SYNC");
        return C_ERR;
    }

    server.repl_transfer_lastio = server.unixtime;
    server.repl_transfer_s = fd;
    server.repl_state = REPL_STATE_CONNECTING;
    return C_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xbcaef(%rip), %r15     # 0x106858
movq 0x818(%r15), %rsi
movl 0x820(%r15), %edx
cmpl $0x0, 0x128(%r15)
movl $0x0, %ecx
je 0x49d8d
movq 0xa8(%r15), %rcx
xorl %edi, %edi
callq 0x30dbc
cmpl $-0x1, %eax
je 0x49ddf
movl %eax, %ebx
movq 0x40(%r15), %rdi
leaq -0x700(%rip), %rcx      # 0x496a6
xorl %r14d, %r14d
movl %eax, %esi
movl $0x3, %edx
xorl %r8d, %r8d
callq 0x2fee7
cmpl $-0x1, %eax
je 0x49e03
movq 0x968(%r15), %rax
movq %rax, 0x868(%r15)
movl %ebx, 0x858(%r15)
movl $0x2, 0x83c(%r15)
jmp 0x49e23
callq 0x26890
movl (%rax), %edi
callq 0x26690
leaq 0x7b505(%rip), %rsi     # 0xc52f7
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x32ea6
jmp 0x49e1d
movl %ebx, %edi
callq 0x26180
leaq 0x7b506(%rip), %rsi     # 0xc5317
movl $0x3, %edi
xorl %eax, %eax
callq 0x32ea6
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: undoConnectWithMaster
void undoConnectWithMaster(void) {
    int fd = server.repl_transfer_s;

    aeDeleteFileEvent(server.el,fd,AE_READABLE|AE_WRITABLE);
    close(fd);
    server.repl_transfer_s = -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xbca21(%rip), %r14     # 0x106858
movl 0x858(%r14), %ebx
movq 0x40(%r14), %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2ffb6
movl %ebx, %edi
callq 0x26180
movl $0xffffffff, 0x858(%r14) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationAbortSyncTransfer
void replicationAbortSyncTransfer(void) {
    serverAssert(server.repl_state == REPL_STATE_TRANSFER);
    undoConnectWithMaster();
    close(server.repl_transfer_fd);
    unlink(server.repl_transfer_tmpfile);
    zfree(server.repl_transfer_tmpfile);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xbc9e5(%rip), %r14     # 0x106858
cmpl $0xe, 0x83c(%r14)
jne 0x49ed1
movl 0x858(%r14), %ebx
movq 0x40(%r14), %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2ffb6
movl %ebx, %edi
callq 0x26180
movl $0xffffffff, 0x858(%r14) # imm = 0xFFFFFFFF
movl 0x85c(%r14), %edi
callq 0x26180
movq 0x860(%r14), %rdi
callq 0x263c0
movq 0x860(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3b3df
leaq 0x7b464(%rip), %rdi     # 0xc533c
leaq 0x7a2c9(%rip), %rsi     # 0xc41a8
movl $0x69f, %edx            # imm = 0x69F
callq 0x654e1
movl $0x1, %edi
callq 0x263d0
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationSetMaster
void replicationSetMaster(char *ip, int port) {
    sdsfree(server.masterhost);
    server.masterhost = sdsnew(ip);
    server.masterport = port;
    if (server.master) freeClient(server.master);
    disconnectAllBlockedClients(); /* Clients blocked in master, now slave. */
    disconnectSlaves(); /* Force our slaves to resync with us as well. */
    replicationDiscardCachedMaster(); /* Don't try a PSYNC. */
    freeReplicationBacklog(); /* Don't allow our chained slaves to PSYNC. */
    cancelReplicationHandshake();
    server.repl_state = REPL_STATE_CONNECT;
    server.master_repl_offset = 0;
    server.repl_down_since = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0xbc954(%rip), %r15     # 0x106858
movq 0x818(%r15), %rdi
callq 0x392b6
movq %r14, %rdi
callq 0x39245
movq %rax, 0x818(%r15)
movl %ebx, 0x820(%r15)
movq 0x828(%r15), %rdi
testq %rdi, %rdi
je 0x49f37
callq 0x40b04
callq 0x807e5
callq 0x40ade
callq 0x49540
callq 0x4720a
callq 0x48f1f
movl $0x1, 0x83c(%r15)
xorl %eax, %eax
movq %rax, 0x7b0(%r15)
movq %rax, 0x878(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationUnsetMaster
void replicationUnsetMaster(void) {
    if (server.masterhost == NULL) return; /* Nothing to do. */
    sdsfree(server.masterhost);
    server.masterhost = NULL;
    if (server.master) {
        if (listLength(server.slaves) == 0) {
            /* If this instance is turned into a master and there are no
             * slaves, it inherits the replication offset from the master.
             * Under certain conditions this makes replicas comparable by
             * replication offset to understand what is the most updated. */
            server.master_repl_offset = server.master->reploff;
            freeReplicationBacklog();
        }
        freeClient(server.master);
    }
    replicationDiscardCachedMaster();
    cancelReplicationHandshake();
    server.repl_state = REPL_STATE_NONE;
}

// Assembly:
pushq %rbx
leaq 0xbc8df(%rip), %rbx     # 0x106858
movq 0x818(%rbx), %rdi
testq %rdi, %rdi
je 0x49fe2
callq 0x392b6
movq $0x0, 0x818(%rbx)
movq 0x828(%rbx), %rax
testq %rax, %rax
je 0x49fce
movq 0x1e0(%rbx), %rcx
cmpq $0x0, 0x28(%rcx)
jne 0x49fc2
movq 0xc8(%rax), %rax
movq %rax, 0x7b0(%rbx)
callq 0x4720a
movq 0x828(%rbx), %rdi
callq 0x40b04
callq 0x49540
callq 0x48f1f
movl $0x0, 0x83c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationCacheMaster
void replicationCacheMaster(client *c) {
    serverAssert(server.master != NULL && server.cached_master == NULL);
    serverLog(LL_NOTICE,"Caching the disconnected master state.");

    /* Unlink the client from the server structures. */
    unlinkClient(c);

    /* Save the master. Server.master will be set to null later by
     * replicationHandleMasterDisconnection(). */
    server.cached_master = server.master;

    /* Invalidate the Peer ID cache. */
    if (c->peerid) {
        sdsfree(c->peerid);
        c->peerid = NULL;
    }

    /* Caching the master happens instead of the actual freeClient() call,
     * so make sure to adjust the replication state. This function will
     * also set server.master to NULL. */
    replicationHandleMasterDisconnection();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xbc471(%rip), %r14     # 0x106858
cmpq $0x0, 0x828(%r14)
je 0x4a46f
cmpq $0x0, 0x830(%r14)
jne 0x4a46f
movq %rdi, %rbx
leaq 0x7b0d3(%rip), %rsi     # 0xc54d8
movl $0x2, %edi
xorl %eax, %eax
callq 0x32ea6
movq %rbx, %rdi
callq 0x40d45
movq 0x828(%r14), %rax
movq %rax, 0x830(%r14)
movq 0x1b8(%rbx), %rdi
testq %rdi, %rdi
je 0x4a443
callq 0x392b6
movq $0x0, 0x1b8(%rbx)
movq $0x0, 0x828(%r14)
movl $0x1, 0x83c(%r14)
movq 0x968(%r14), %rax
movq %rax, 0x878(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7b02c(%rip), %rdi     # 0xc54a2
leaq 0x79d2b(%rip), %rsi     # 0xc41a8
movl $0x775, %edx            # imm = 0x775
callq 0x654e1
movl $0x1, %edi
callq 0x263d0
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: replicationCountAcksByOffset
int replicationCountAcksByOffset(long long offset) {
    listIter li;
    listNode *ln;
    int count = 0;

    listRewind(server.slaves,&li);
    while((ln = listNext(&li))) {
        client *slave = ln->value;

        if (slave->replstate != SLAVE_STATE_ONLINE) continue;
        if (slave->repl_ack_off >= offset) count++;
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xbc292(%rip), %rax     # 0x106858
movq 0x1e0(%rax), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x2e582
movq %r14, %rdi
callq 0x2e59f
xorl %ebp, %ebp
testq %rax, %rax
je 0x4a612
movq %rsp, %r14
movq 0x10(%rax), %rax
cmpl $0x9, 0xa0(%rax)
jne 0x4a605
xorl %ecx, %ecx
cmpq %rbx, 0xd0(%rax)
setge %cl
addl %ecx, %ebp
movq %r14, %rdi
callq 0x2e59f
testq %rax, %rax
jne 0x4a5ea
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/replication.c
// Function: waitCommand
void waitCommand(client *c) {
    mstime_t timeout;
    long numreplicas, ackreplicas;
    long long offset = c->woff;

    /* Argument parsing. */
    if (getLongFromObjectOrReply(c,c->argv[1],&numreplicas,NULL) != C_OK)
        return;
    if (getTimeoutFromObjectOrReply(c,c->argv[2],&timeout,UNIT_MILLISECONDS)
        != C_OK) return;

    /* First try without blocking at all. */
    ackreplicas = replicationCountAcksByOffset(c->woff);
    if (ackreplicas >= numreplicas || c->flags & CLIENT_MULTI) {
        addReplyLongLong(c,ackreplicas);
        return;
    }

    /* Otherwise block the client and put it into our list of clients
     * waiting for ack from slaves. */
    c->bpop.timeout = timeout;
    c->bpop.reploffset = offset;
    c->bpop.numreplicas = numreplicas;
    listAddNodeTail(server.clients_waiting_acks,c);
    blockClient(c,BLOCKED_WAIT);

    /* Make sure that the server will send an ACK request to all the slaves
     * before returning to the event loop. */
    replicationRequestAckFromSlaves();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x198(%rdi), %r14
movq 0x8(%rax), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x44ba1
testl %eax, %eax
jne 0x4a6db
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x8058c
testl %eax, %eax
jne 0x4a6db
movq 0x198(%rbx), %rdi
callq 0x4a5b4
movslq %eax, %rsi
movq 0x8(%rsp), %rax
cmpq %rsi, %rax
jle 0x4a6d3
testb $0x8, 0x98(%rbx)
jne 0x4a6d3
movq 0x10(%rsp), %rcx
movq %rcx, 0x170(%rbx)
movq %r14, 0x190(%rbx)
movl %eax, 0x188(%rbx)
leaq 0xbc1ae(%rip), %r14     # 0x106858
movq 0x8e8(%r14), %rdi
movq %rbx, %rsi
callq 0x2e40f
movq %rbx, %rdi
movl $0x2, %esi
callq 0x80600
movl $0x1, 0x8f0(%r14)
jmp 0x4a6db
movq %rbx, %rdi
callq 0x40606
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbCheckThenExit
void rdbCheckThenExit(int linenum, char *reason, ...) {
    va_list ap;
    char msg[1024];
    int len;

    len = snprintf(msg,sizeof(msg),
        "Internal error in RDB reading function at rdb.c:%d -> ", linenum);
    va_start(ap,reason);
    vsnprintf(msg+len,sizeof(msg)-len,reason,ap);
    va_end(ap);

    if (!rdbCheckMode) {
        serverLog(LL_WARNING, "%s", msg);
        char *argv[2] = {"",server.rdb_filename};
        redis_check_rdb_main(2,argv);
    } else {
        rdbCheckError("%s",msg);
    }
    exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rsi, %rbx
movl %edi, %r10d
leaq 0x30(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x4ac91
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x7ac70(%rip), %rdx     # 0xc5908
leaq 0xe0(%rsp), %rdi
movl $0x400, %r14d           # imm = 0x400
movl $0x400, %esi            # imm = 0x400
movl %r10d, %ecx
xorl %eax, %eax
callq 0x26120
movabsq $0x3000000010, %rdx     # imm = 0x3000000010
leaq 0x10(%rsp), %rcx
movq %rdx, (%rcx)
leaq 0x500(%rsp), %rdx
movq %rdx, 0x8(%rcx)
movq %r15, 0x10(%rcx)
cltq
leaq (%rsp,%rax), %rdi
addq $0xe0, %rdi
subq %rax, %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x26820
leaq 0xd0c37(%rip), %rax     # 0x11b930
cmpl $0x0, (%rax)
jne 0x4ad44
leaq 0x84b75(%rip), %rsi     # 0xcf87a
leaq 0xe0(%rsp), %rdx
movl $0x3, %edi
xorl %eax, %eax
callq 0x32ea6
leaq 0x78d4d(%rip), %rax     # 0xc3a6d
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xbbb2b(%rip), %rax     # 0x106858
movq 0x738(%rax), %rax
movq %rax, 0x8(%rsi)
movl $0x2, %edi
callq 0x84238
jmp 0x4ad5a
leaq 0x84b2f(%rip), %rdi     # 0xcf87a
leaq 0xe0(%rsp), %rsi
xorl %eax, %eax
callq 0x839c9
movl $0x1, %edi
callq 0x262d0
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/./rio.h
// Function: rioRead
static inline size_t rioRead(rio *r, void *buf, size_t len) {
    while (len) {
        size_t bytes_to_read = (r->max_processing_chunk && r->max_processing_chunk < len) ? r->max_processing_chunk : len;
        if (r->read(r,buf,bytes_to_read) == 0)
            return 0;
        if (r->update_cksum) r->update_cksum(r,buf,bytes_to_read);
        buf = (char*)buf + bytes_to_read;
        len -= bytes_to_read;
        r->processed_bytes += bytes_to_read;
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
testq %r14, %r14
je 0x4af04
movq 0x38(%r12), %rax
cmpq %r14, %rax
movq %r14, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %r14, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *(%r12)
movq %rax, %rbp
testq %rax, %rax
je 0x4aefd
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x4aef2
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r15
subq %r13, %r14
addq %r13, 0x30(%r12)
testq %rbp, %rbp
jne 0x4aead
jmp 0x4af09
movl $0x1, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbSaveLen
int rdbSaveLen(rio *rdb, uint32_t len) {
    unsigned char buf[2];
    size_t nwritten;

    if (len < (1<<6)) {
        /* Save a 6 bit len */
        buf[0] = (len&0xFF)|(RDB_6BITLEN<<6);
        if (rdbWriteRaw(rdb,buf,1) == -1) return -1;
        nwritten = 1;
    } else if (len < (1<<14)) {
        /* Save a 14 bit len */
        buf[0] = ((len>>8)&0xFF)|(RDB_14BITLEN<<6);
        buf[1] = len&0xFF;
        if (rdbWriteRaw(rdb,buf,2) == -1) return -1;
        nwritten = 2;
    } else {
        /* Save a 32 bit len */
        buf[0] = (RDB_32BITLEN<<6);
        if (rdbWriteRaw(rdb,buf,1) == -1) return -1;
        len = htonl(len);
        if (rdbWriteRaw(rdb,&len,4) == -1) return -1;
        nwritten = 1+4;
    }
    return nwritten;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
cmpl $0x3f, %esi
ja 0x4b082
leaq 0x2(%rsp), %rax
movb %sil, (%rax)
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ad7c
movl $0x1, %ecx
jmp 0x4b0b2
cmpl $0x3fff, %esi           # imm = 0x3FFF
ja 0x4b0c2
movl %esi, %ecx
shrl $0x8, %ecx
orb $0x40, %cl
leaq 0x2(%rsp), %rax
movb %cl, (%rax)
movb %sil, 0x1(%rax)
movl $0x2, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4ad7c
movl $0x2, %ecx
cmpl $-0x1, %eax
je 0x4b0bb
movl %ecx, %ebp
jmp 0x4b103
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4b103
leaq 0x2(%rsp), %rsi
movb $-0x80, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x4ad7c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x4b103
leaq 0x4(%rsp), %rsi
movl (%rsi), %eax
bswapl %eax
movl %eax, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0x4ad7c
movl $0x5, %ecx
cmpl $-0x1, %eax
jne 0x4b0b7
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbEncodeInteger
int rdbEncodeInteger(long long value, unsigned char *enc) {
    if (value >= -(1<<7) && value <= (1<<7)-1) {
        enc[0] = (RDB_ENCVAL<<6)|RDB_ENC_INT8;
        enc[1] = value&0xFF;
        return 2;
    } else if (value >= -(1<<15) && value <= (1<<15)-1) {
        enc[0] = (RDB_ENCVAL<<6)|RDB_ENC_INT16;
        enc[1] = value&0xFF;
        enc[2] = (value>>8)&0xFF;
        return 3;
    } else if (value >= -((long long)1<<31) && value <= ((long long)1<<31)-1) {
        enc[0] = (RDB_ENCVAL<<6)|RDB_ENC_INT32;
        enc[1] = value&0xFF;
        enc[2] = (value>>8)&0xFF;
        enc[3] = (value>>16)&0xFF;
        enc[4] = (value>>24)&0xFF;
        return 5;
    } else {
        return 0;
    }
}

// Assembly:
movq %rdi, %rcx
movsbq %cl, %rax
cmpq %rdi, %rax
jne 0x4b2f6
movb $-0x40, (%rsi)
movl $0x2, %eax
movl $0x1, %edx
jmp 0x4b33e
movswq %cx, %rax
cmpq %rcx, %rax
jne 0x4b315
movb $-0x3f, (%rsi)
movb %cl, 0x1(%rsi)
shrq $0x8, %rcx
movl $0x3, %eax
movl $0x2, %edx
jmp 0x4b33e
movslq %ecx, %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
jne 0x4b341
movb $-0x3e, (%rsi)
movb %cl, 0x1(%rsi)
movb %ch, 0x2(%rsi)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x3(%rsi)
shrq $0x18, %rcx
movl $0x5, %eax
movl $0x4, %edx
movb %cl, (%rsi,%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbSaveLzfBlob
ssize_t rdbSaveLzfBlob(rio *rdb, void *data, size_t compress_len,
                       size_t original_len) {
    unsigned char byte;
    ssize_t n, nwritten = 0;

    /* Data compressed! Let's save it on disk */
    byte = (RDB_ENCVAL<<6)|RDB_ENC_LZF;
    if ((n = rdbWriteRaw(rdb,&byte,1)) == -1) goto writeerr;
    nwritten += n;

    if ((n = rdbSaveLen(rdb,compress_len)) == -1) goto writeerr;
    nwritten += n;

    if ((n = rdbSaveLen(rdb,original_len)) == -1) goto writeerr;
    nwritten += n;

    if ((n = rdbWriteRaw(rdb,data,compress_len)) == -1) goto writeerr;
    nwritten += n;

    return nwritten;

writeerr:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0xf(%rsp), %rsi
movb $-0x3d, (%rsi)
movl $0x1, %edx
callq 0x4ad7c
movq $-0x1, %rbx
cmpl $-0x1, %eax
je 0x4b67d
movl %eax, %ebp
movq %r15, 0x10(%rsp)
movq %r12, %rdi
movl %r14d, %esi
callq 0x4b054
cmpl $-0x1, %eax
je 0x4b67d
movl %eax, %r15d
movq %r12, %rdi
movl %r13d, %esi
callq 0x4b054
cmpl $-0x1, %eax
je 0x4b67d
movl %eax, %r13d
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x4ad7c
cmpl $-0x1, %eax
je 0x4b67d
movslq %ebp, %rcx
cltq
movslq %r15d, %rdx
movslq %r13d, %rbx
addq %rdx, %rbx
addq %rcx, %rbx
addq %rax, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbSaveLzfStringObject
ssize_t rdbSaveLzfStringObject(rio *rdb, unsigned char *s, size_t len) {
    size_t comprlen, outlen;
    void *out;

    /* We require at least four bytes compression for this to be worth it */
    if (len <= 4) return 0;
    outlen = len-4;
    if ((out = zmalloc(outlen+1)) == NULL) return 0;
    comprlen = lzf_compress(s, len, out, outlen);
    if (comprlen == 0) {
        zfree(out);
        return 0;
    }
    ssize_t nwritten = rdbSaveLzfBlob(rdb, out, comprlen, len);
    zfree(out);
    return nwritten;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x5, %rdx
jb 0x4b6e2
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq -0x3(%rdx), %rdi
callq 0x3b29d
testq %rax, %rax
je 0x4b6e2
movq %rax, %rbx
leal -0x4(%r14), %ecx
movq %r12, %rdi
movl %r14d, %esi
movq %rax, %rdx
callq 0x3b6d0
testl %eax, %eax
je 0x4b6e7
movl %eax, %edx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x4b5ef
movq %rax, %r14
jmp 0x4b6ea
xorl %r14d, %r14d
jmp 0x4b6f2
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x3b3df
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbLoadLzfStringObject
void *rdbLoadLzfStringObject(rio *rdb, int flags) {
    int plain = flags & RDB_LOAD_PLAIN;
    unsigned int len, clen;
    unsigned char *c = NULL;
    sds val = NULL;

    if ((clen = rdbLoadLen(rdb,NULL)) == RDB_LENERR) return NULL;
    if ((len = rdbLoadLen(rdb,NULL)) == RDB_LENERR) return NULL;
    if ((c = zmalloc(clen)) == NULL) goto err;

    /* Allocate our target according to the uncompressed size. */
    if (plain) {
        val = zmalloc(len);
    } else {
        if ((val = sdsnewlen(NULL,len)) == NULL) goto err;
    }

    /* Load the compressed representation and uncompress it to target. */
    if (rioRead(rdb,c,clen) == 0) goto err;
    if (lzf_decompress(c,clen,val,len) == 0) {
        if (rdbCheckMode) rdbCheckSetError("Invalid LZF compressed string");
        goto err;
    }
    zfree(c);

    if (plain)
        return val;
    else
        return createObject(OBJ_STRING,val);
err:
    zfree(c);
    if (plain)
        zfree(val);
    else
        sdsfree(val);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r12
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x4b10c
cmpl $-0x1, %eax
je 0x4b893
movl %eax, %ebp
xorl %r15d, %r15d
movq %r12, %rdi
xorl %esi, %esi
callq 0x4b10c
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x4b893
movl %ebp, 0x24(%rsp)
movl %ebp, %r14d
movq %r14, %rdi
callq 0x3b29d
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x4b77e
movl 0xc(%rsp), %esi
testb $0x2, %bl
jne 0x4b786
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x3910c
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x4b793
jmp 0x4b872
xorl %r15d, %r15d
jmp 0x4b872
movq %rsi, %rdi
callq 0x3b29d
movq %rax, 0x10(%rsp)
movl %ebx, 0x8(%rsp)
movq 0x18(%rsp), %r15
testq %r14, %r14
je 0x4b80c
movq %r14, %rbx
movq 0x38(%r12), %rax
cmpq %r14, %rax
movq %r14, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %r14, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *(%r12)
movq %rax, %rbp
testq %rax, %rax
je 0x4b7f4
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x4b7e4
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r15
movq %rbx, %r14
subq %r13, %r14
addq %r13, 0x30(%r12)
jmp 0x4b7f7
movq %rbx, %r14
testq %rbp, %rbp
jne 0x4b79c
testq %rbx, %rbx
je 0x4b80c
movq 0x10(%rsp), %r15
movl 0x8(%rsp), %ebx
jmp 0x4b872
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl 0x24(%rsp), %esi
movq 0x10(%rsp), %r15
movq %r15, %rdx
movl 0xc(%rsp), %ecx
callq 0x3baec
testl %eax, %eax
je 0x4b854
movq %rbx, %rdi
callq 0x3b3df
testb $0x2, 0x8(%rsp)
jne 0x4b893
xorl %edi, %edi
movq %r15, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x43ab4
leaq 0xd00d5(%rip), %rax     # 0x11b930
cmpl $0x0, (%rax)
movl 0x8(%rsp), %ebx
je 0x4b872
leaq 0x7a0f9(%rip), %rdi     # 0xc5964
xorl %eax, %eax
callq 0x83bd9
movq 0x18(%rsp), %rdi
callq 0x3b3df
movq %r15, %rdi
testb $0x2, %bl
jne 0x4b88b
callq 0x392b6
jmp 0x4b890
callq 0x3b3df
xorl %r15d, %r15d
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/rdb.c
// Function: rdbSaveRawString
ssize_t rdbSaveRawString(rio *rdb, unsigned char *s, size_t len) {
    int enclen;
    ssize_t n, nwritten = 0;

    /* Try integer encoding */
    if (len <= 11) {
        unsigned char buf[5];
        if ((enclen = rdbTryIntegerEncoding((char*)s,len,buf)) > 0) {
            if (rdbWriteRaw(rdb,buf,enclen) == -1) return -1;
            return enclen;
        }
    }

    /* Try LZF compression - under 20 bytes it's unable to compress even
     * aaaaaaaaaaaaaaaaaa so skip it */
    if (server.rdb_compression && len > 20) {
        n = rdbSaveLzfStringObject(rdb,s,len);
        if (n == -1) return -1;
        if (n > 0) return n;
        /* Return value of 0 means data can't be compressed, save the old way */
    }

    /* Store verbatim */
    if ((n = rdbSaveLen(rdb,len)) == -1) return -1;
    nwritten += n;
    if (len > 0) {
        if (rdbWriteRaw(rdb,s,len) == -1) return -1;
        nwritten += len;
    }
    return nwritten;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0xb, %rdx
ja 0x4b8fc
leaq 0x3(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4b564
movl %eax, %ebp
testl %eax, %eax
je 0x4b8f8
movl %ebp, %r13d
leaq 0x3(%rsp), %rsi
movq %r15, %rdi
movq %r13, %rdx
callq 0x4ad7c
cmpl $-0x1, %eax
movq $-0x1, %r12
cmovneq %r13, %r12
jmp 0x4b8f8
testl %ebp, %ebp
jne 0x4b96d
cmpq $0x15, %rbx
jb 0x4b92e
leaq 0xbaf4f(%rip), %rax     # 0x106858
cmpl $0x0, 0x740(%rax)
je 0x4b92e
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4b68f
cmpq $-0x1, %rax
je 0x4b966
movq %rax, %r12
testq %rax, %rax
jg 0x4b96d
movq %r15, %rdi
movl %ebx, %esi
callq 0x4b054
cmpl $-0x1, %eax
je 0x4b966
movslq %eax, %r12
testq %rbx, %rbx
je 0x4b96d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4ad7c
addq %rbx, %r12
cmpl $-0x1, %eax
movq $-0x1, %rax
cmoveq %rax, %r12
jmp 0x4b96d
movq $-0x1, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq