LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbbc07(%rip), %r14     # 0x1018a8
movl 0x84c(%r14), %ecx
cmpl $0x2, %ecx
je 0x45cc3
cmpl $0xe, %ecx
jne 0x45cb9
callq 0x46b85
jmp 0x45cec
addl $-0xe, %ecx
xorl %eax, %eax
cmpl $-0xb, %ecx
jb 0x45cfc
movl 0x868(%r14), %ebx
movq 0x40(%r14), %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2cf0e
movl %ebx, %edi
callq 0x26180
movl $0xffffffff, 0x868(%r14) # imm = 0xFFFFFFFF
movl $0x1, 0x84c(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbb609(%rip), %rbx     # 0x1018a8
cmpq $0x0, 0x840(%rbx)
je 0x462da
leaq 0x7c2e3(%rip), %rsi     # 0xc2593
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
movq 0x840(%rbx), %rdi
andl $-0x3, 0x98(%rdi)
callq 0x3d73b
movq $0x0, 0x840(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbb5bf(%rip), %r14     # 0x1018a8
movq 0x840(%r14), %rsi
movq %rsi, 0x838(%r14)
movq $0x0, 0x840(%r14)
movl %edi, 0x8(%rsi)
andl $0xfffffbbf, 0x98(%rsi) # imm = 0xFFFFFBBF
movl $0x1, 0x9c(%rsi)
movq 0x978(%r14), %rax
movq %rax, 0x88(%rsi)
movl $0xf, 0x84c(%r14)
movq 0x1c8(%r14), %rdi
callq 0x2b24b
movq 0x40(%r14), %rdi
movq 0x838(%r14), %r8
leaq -0xa387(%rip), %rcx     # 0x3bfc9
movl %ebx, %esi
movl $0x1, %edx
callq 0x2ce46
testl %eax, %eax
je 0x4638e
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x7c24b(%rip), %rsi     # 0xc25be
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movq 0x838(%r14), %rdi
callq 0x3db03
movq 0x838(%r14), %rdi
callq 0x3c29e
testl %eax, %eax
je 0x463f5
movq 0x40(%r14), %rdi
movq 0x838(%r14), %r8
leaq -0x85ab(%rip), %rcx     # 0x3de05
movl %ebx, %esi
movl $0x2, %edx
callq 0x2ce46
testl %eax, %eax
je 0x463f5
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x7c23c(%rip), %rsi     # 0xc260f
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movq 0x838(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3db03
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbae22(%rip), %r15     # 0x1018a8
movq 0x828(%r15), %rsi
movl 0x830(%r15), %edx
cmpl $0x0, 0x128(%r15)
movl $0x0, %ecx
je 0x46aaa
movq 0xa8(%r15), %rcx
xorl %edi, %edi
callq 0x2dceb
cmpl $-0x1, %eax
je 0x46afc
movl %eax, %ebx
movq 0x40(%r15), %rdi
leaq -0x6c6(%rip), %rcx      # 0x463fd
xorl %r14d, %r14d
movl %eax, %esi
movl $0x3, %edx
xorl %r8d, %r8d
callq 0x2ce46
cmpl $-0x1, %eax
je 0x46b20
movq 0x978(%r15), %rax
movq %rax, 0x878(%r15)
movl %ebx, 0x868(%r15)
movl $0x2, 0x84c(%r15)
jmp 0x46b40
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x7b87c(%rip), %rsi     # 0xc238b
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
jmp 0x46b3a
movl %ebx, %edi
callq 0x26180
leaq 0x7b87d(%rip), %rsi     # 0xc23ab
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbad54(%rip), %r14     # 0x1018a8
movl 0x868(%r14), %ebx
movq 0x40(%r14), %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2cf0e
movl %ebx, %edi
callq 0x26180
movl $0xffffffff, 0x868(%r14) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbad18(%rip), %r14     # 0x1018a8
cmpl $0xe, 0x84c(%r14)
jne 0x46bee
movl 0x868(%r14), %ebx
movq 0x40(%r14), %rdi
movl %ebx, %esi
movl $0x3, %edx
callq 0x2cf0e
movl %ebx, %edi
callq 0x26180
movl $0xffffffff, 0x868(%r14) # imm = 0xFFFFFFFF
movl 0x86c(%r14), %edi
callq 0x26180
movq 0x870(%r14), %rdi
callq 0x263b0
movq 0x870(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38413
leaq 0x7b7db(%rip), %rdi     # 0xc23d0
leaq 0x7a640(%rip), %rsi     # 0xc123c
movl $0x6a0, %edx            # imm = 0x6A0
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbac87(%rip), %r15     # 0x1018a8
movq 0x828(%r15), %rdi
callq 0x36330
movq %r14, %rdi
callq 0x362b0
movq %rax, 0x828(%r15)
movl %ebx, 0x830(%r15)
movq 0x838(%r15), %rdi
testq %rdi, %rdi
je 0x46c54
callq 0x3d73b
callq 0x7cd99
callq 0x3d715
callq 0x46297
callq 0x4400c
callq 0x45c96
movl $0x1, 0x84c(%r15)
xorl %eax, %eax
movq %rax, 0x7c0(%r15)
movq %rax, 0x888(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xbac12(%rip), %rbx     # 0x1018a8
movq 0x828(%rbx), %rdi
testq %rdi, %rdi
je 0x46cff
callq 0x36330
movq $0x0, 0x828(%rbx)
movq 0x838(%rbx), %rdi
testq %rdi, %rdi
je 0x46ceb
movq 0x1e0(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x46ce6
movq 0xc8(%rdi), %rax
movq %rax, 0x7c0(%rbx)
callq 0x4400c
movq 0x838(%rbx), %rdi
callq 0x3d73b
callq 0x46297
callq 0x45c96
movl $0x0, 0x84c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xba7a3(%rip), %r14     # 0x1018a8
cmpq $0x0, 0x838(%r14)
je 0x4718d
cmpq $0x0, 0x840(%r14)
jne 0x4718d
movq %rdi, %rbx
leaq 0x7b449(%rip), %rsi     # 0xc256c
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
movq %rbx, %rdi
callq 0x3d981
movq 0x838(%r14), %rax
movq %rax, 0x840(%r14)
movq 0x1b8(%rbx), %rdi
testq %rdi, %rdi
je 0x47161
callq 0x36330
movq $0x0, 0x1b8(%rbx)
movq $0x0, 0x838(%r14)
movl $0x1, 0x84c(%r14)
movq 0x978(%r14), %rax
movq %rax, 0x888(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7b3a2(%rip), %rdi     # 0xc2536
leaq 0x7a0a1(%rip), %rsi     # 0xc123c
movl $0x776, %edx            # imm = 0x776
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationScriptCacheAdd
void replicationScriptCacheAdd(sds sha1) {
    int retval;
    sds key = sdsdup(sha1);

    /* Evict oldest. */
    if (listLength(server.repl_scriptcache_fifo) == server.repl_scriptcache_size)
    {
        listNode *ln = listLast(server.repl_scriptcache_fifo);
        sds oldest = listNodeValue(ln);

        retval = dictDelete(server.repl_scriptcache_dict,oldest);
        serverAssert(retval == DICT_OK);
        listDelNode(server.repl_scriptcache_fifo,ln);
    }

    /* Add current. */
    retval = dictAdd(server.repl_scriptcache_dict,key,NULL);
    listAddNodeHead(server.repl_scriptcache_fifo,key);
    serverAssert(retval == DICT_OK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x362e0
movq %rax, %rbx
leaq 0xba6ae(%rip), %r15     # 0x1018a8
movq 0x8e8(%r15), %rax
movl 0x8f0(%r15), %ecx
cmpq %rcx, 0x28(%rax)
jne 0x47235
movq 0x8(%rax), %r14
movq 0x10(%r14), %rsi
movq 0x8e0(%r15), %rdi
callq 0x2ecb5
testl %eax, %eax
jne 0x4727b
movq 0x8e8(%r15), %rdi
movq %r14, %rsi
callq 0x2b331
movq 0x8e0(%r15), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2e9b8
movl %eax, %ebp
movq 0x8e8(%r15), %rdi
movq %rbx, %rsi
callq 0x2b1ec
testl %ebp, %ebp
jne 0x47266
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x79cc3(%rip), %rdi     # 0xc0f30
leaq 0x79fc8(%rip), %rsi     # 0xc123c
movl $0x81c, %edx            # imm = 0x81C
jmp 0x4728e
leaq 0x79cae(%rip), %rdi     # 0xc0f30
leaq 0x79fb3(%rip), %rsi     # 0xc123c
movl $0x815, %edx            # imm = 0x815
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xba5c4(%rip), %rax     # 0x1018a8
movq 0x1e0(%rax), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x2b3b7
movq %r14, %rdi
callq 0x2b3d4
xorl %ebp, %ebp
testq %rax, %rax
je 0x47330
movq %rsp, %r14
movq 0x10(%rax), %rax
cmpl $0x9, 0xa0(%rax)
jne 0x47323
xorl %ecx, %ecx
cmpq %rbx, 0xd0(%rax)
setge %cl
addl %ecx, %ebp
movq %r14, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x47308
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0x41718
testl %eax, %eax
jne 0x473f9
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x7cb4c
testl %eax, %eax
jne 0x473f9
movq 0x198(%rbx), %rdi
callq 0x472d2
movslq %eax, %rsi
movq 0x8(%rsp), %rax
cmpq %rsi, %rax
jle 0x473f1
testb $0x8, 0x98(%rbx)
jne 0x473f1
movq 0x10(%rsp), %rcx
movq %rcx, 0x170(%rbx)
movq %r14, 0x190(%rbx)
movl %eax, 0x188(%rbx)
leaq 0xba4e0(%rip), %r14     # 0x1018a8
movq 0x8f8(%r14), %rdi
movq %rbx, %rsi
callq 0x2b24b
movq %rbx, %rdi
movl $0x2, %esi
callq 0x7cbc0
movl $0x1, 0x900(%r14)
jmp 0x473f9
movq %rbx, %rdi
callq 0x3d23f
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: processClientsWaitingReplicas
void processClientsWaitingReplicas(void) {
    long long last_offset = 0;
    int last_numreplicas = 0;

    listIter li;
    listNode *ln;

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

        /* Every time we find a client that is satisfied for a given
         * offset and number of replicas, we remember it so the next client
         * may be unblocked without calling replicationCountAcksByOffset()
         * if the requested offset / replicas were equal or less. */
        if (last_offset && last_offset > c->bpop.reploffset &&
                           last_numreplicas > c->bpop.numreplicas)
        {
            unblockClient(c);
            addReplyLongLong(c,last_numreplicas);
        } else {
            int numreplicas = replicationCountAcksByOffset(c->bpop.reploffset);

            if (numreplicas >= c->bpop.numreplicas) {
                last_offset = c->bpop.reploffset;
                last_numreplicas = numreplicas;
                unblockClient(c);
                addReplyLongLong(c,numreplicas);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xba448(%rip), %rax     # 0x1018a8
movq 0x8f8(%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x2b3b7
movq %rbx, %rdi
callq 0x2b3d4
testq %rax, %rax
je 0x474e0
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbx
xorl %ebp, %ebp
movq 0x10(%rax), %r14
movq 0x190(%r14), %rdi
testq %r15, %r15
je 0x474a9
cmpq %rdi, %r15
jle 0x474a9
cmpl 0x188(%r14), %ebp
jg 0x474c0
callq 0x472d2
cmpl 0x188(%r14), %eax
jl 0x474d3
movq 0x190(%r14), %r15
movl %eax, %ebp
movq %r14, %rdi
callq 0x7cca6
movslq %ebp, %rsi
movq %r14, %rdi
callq 0x3d23f
movq %rbx, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x4748b
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationGetSlaveOffset
long long replicationGetSlaveOffset(void) {
    long long offset = 0;

    if (server.masterhost != NULL) {
        if (server.master) {
            offset = server.master->reploff;
        } else if (server.cached_master) {
            offset = server.cached_master->reploff;
        }
    }
    /* offset may be -1 when the master does not support it at all, however
     * this function is designed to return an offset that can express the
     * amount of data processed by the master, so we return a positive
     * integer. */
    if (offset < 0) offset = 0;
    return offset;
}

// Assembly:
leaq 0xba3b6(%rip), %rcx     # 0x1018a8
cmpq $0x0, 0x828(%rcx)
je 0x4751d
movq 0x838(%rcx), %rax
testq %rax, %rax
jne 0x47514
movq 0x840(%rcx), %rax
testq %rax, %rax
je 0x4751d
movq 0xc8(%rax), %rcx
jmp 0x4751f
xorl %ecx, %ecx
xorl %eax, %eax
testq %rcx, %rcx
cmovgq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0x479ad
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 0x7afd4(%rip), %rdx     # 0xc2988
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 0x26810
leaq 0xcef7b(%rip), %rax     # 0x116990
cmpl $0x0, (%rax)
jne 0x47a60
leaq 0x84f59(%rip), %rsi     # 0xcc97a
leaq 0xe0(%rsp), %rdx
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
leaq 0x79079(%rip), %rax     # 0xc0ab5
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xb9e5f(%rip), %rax     # 0x1018a8
movq 0x748(%rax), %rax
movq %rax, 0x8(%rsi)
movl $0x2, %edi
callq 0x80789
jmp 0x47a76
leaq 0x84f13(%rip), %rdi     # 0xcc97a
leaq 0xe0(%rsp), %rsi
xorl %eax, %eax
callq 0x7ff89
movl $0x1, %edi
callq 0x262c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0x1, %ebx
testq %rdx, %rdx
je 0x47bf4
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
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)
testq %rax, %rax
je 0x47bf2
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x47be3
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r15
addq %r13, 0x30(%r12)
subq %r13, %r14
jne 0x47ba6
jmp 0x47bf4
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x3f, %esi
ja 0x47d2c
leaq 0xa(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x47a98
movl $0x1, %ecx
jmp 0x47d58
cmpl $0x3fff, %ebp           # imm = 0x3FFF
ja 0x47d6a
movl %ebp, %eax
shrl $0x8, %eax
orb $0x40, %al
leaq 0xa(%rsp), %rsi
movb %al, (%rsi)
movb %bpl, 0x1(%rsi)
movl $0x2, %edx
movq %rbx, %rdi
callq 0x47a98
movl $0x2, %ecx
cmpl $-0x1, %eax
je 0x47d62
movl %ecx, %r14d
jmp 0x47daa
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x47daa
leaq 0xa(%rsp), %rsi
movb $-0x80, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x47a98
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x47daa
bswapl %ebp
leaq 0xc(%rsp), %rsi
movl %ebp, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0x47a98
movl $0x5, %ecx
cmpl $-0x1, %eax
jne 0x47d5d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadLen
uint32_t rdbLoadLen(rio *rdb, int *isencoded) {
    unsigned char buf[2];
    uint32_t len;
    int type;

    if (isencoded) *isencoded = 0;
    if (rioRead(rdb,buf,1) == 0) return RDB_LENERR;
    type = (buf[0]&0xC0)>>6;
    if (type == RDB_ENCVAL) {
        /* Read a 6 bit encoding type. */
        if (isencoded) *isencoded = 1;
        return buf[0]&0x3F;
    } else if (type == RDB_6BITLEN) {
        /* Read a 6 bit len. */
        return buf[0]&0x3F;
    } else if (type == RDB_14BITLEN) {
        /* Read a 14 bit len. */
        if (rioRead(rdb,buf+1,1) == 0) return RDB_LENERR;
        return ((buf[0]&0x3F)<<8)|buf[1];
    } else if (type == RDB_32BITLEN) {
        /* Read a 32 bit len. */
        if (rioRead(rdb,&len,4) == 0) return RDB_LENERR;
        return ntohl(len);
    } else {
        rdbExitReportCorruptRDB(
            "Unknown length encoding %d in rdbLoadLen()",type);
        return -1; /* Never reached. */
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x47dd5
movl $0x0, (%r14)
leaq 0xa(%rsp), %r15
movl $0x1, %r13d
movq 0x38(%rbx), %rax
cmpq %r13, %rax
movq %r13, %r12
cmovbq %rax, %r12
testq %rax, %rax
cmoveq %r13, %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%rbx)
testq %rax, %rax
je 0x47f19
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x47e1d
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%rax
addq %r12, %r15
addq %r12, 0x30(%rbx)
subq %r12, %r13
jne 0x47de0
movzbl 0xa(%rsp), %eax
movl %eax, %ecx
shrl $0x6, %ecx
cmpl $0x3, %ecx
jne 0x47e4c
testq %r14, %r14
je 0x47e44
movl $0x1, (%r14)
andl $0x3f, %eax
jmp 0x47f1e
cmpb $0x40, %al
jb 0x47f1e
cmpl $0x1, %ecx
jne 0x47ec1
movl $0x1, %r12d
leaq 0xb(%rsp), %r14
movq 0x38(%rbx), %rax
cmpq %r12, %rax
movq %r12, %r15
cmovbq %rax, %r15
testq %rax, %rax
cmoveq %r12, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *(%rbx)
testq %rax, %rax
je 0x47f19
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x47ea1
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *%rax
addq %r15, %r14
addq %r15, 0x30(%rbx)
subq %r15, %r12
jne 0x47e64
movzbl 0xa(%rsp), %ecx
andl $0x3f, %ecx
shll $0x8, %ecx
movzbl 0xb(%rsp), %eax
orl %ecx, %eax
jmp 0x47f1e
leaq 0xc(%rsp), %r14
movl $0x4, %r12d
movq 0x38(%rbx), %rax
cmpq %r12, %rax
movq %r12, %r15
cmovbq %rax, %r15
testq %rax, %rax
cmoveq %r12, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *(%rbx)
testq %rax, %rax
je 0x47f19
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x47f05
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *%rax
addq %r15, %r14
addq %r15, 0x30(%rbx)
subq %r15, %r12
jne 0x47ecc
movl 0xc(%rsp), %eax
bswapl %eax
jmp 0x47f1e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0x47f47
movb $-0x40, (%rsi)
movl $0x2, %eax
movl $0x1, %edx
jmp 0x47f8f
movswq %cx, %rax
cmpq %rcx, %rax
jne 0x47f66
movb $-0x3f, (%rsi)
movb %cl, 0x1(%rsi)
shrq $0x8, %rcx
movl $0x3, %eax
movl $0x2, %edx
jmp 0x47f8f
movslq %ecx, %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
jne 0x47f92
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_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbTryIntegerEncoding
int rdbTryIntegerEncoding(char *s, size_t len, unsigned char *enc) {
    long long value;
    char *endptr, buf[32];

    /* Check if it's possible to encode this value as a number */
    value = strtoll(s, &endptr, 10);
    if (endptr[0] != '\0') return 0;
    ll2string(buf,32,value);

    /* If the number converted back into a string is not identical
     * then it's not possible to encode the string as integer */
    if (strlen(buf) != len || memcmp(buf,s,len)) return 0;

    return rdbEncodeInteger(value,enc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r13
movq %r13, %rsi
movl $0xa, %edx
callq 0x26af0
movq %rax, %r14
movq (%r13), %rax
xorl %ebp, %ebp
cmpb $0x0, (%rax)
jne 0x481cc
leaq 0x10(%rsp), %r13
movl $0x20, %esi
movq %r13, %rdi
movq %r14, %rdx
callq 0x3ff83
movq %r13, %rdi
callq 0x26500
cmpq %r15, %rax
jne 0x481cc
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x266f0
testl %eax, %eax
jne 0x481cc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x47f2c
movl %eax, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0x47a98
movq $-0x1, %rbx
cmpl $-0x1, %eax
je 0x4826b
movl %eax, %ebp
movq %r15, 0x10(%rsp)
movq %r12, %rdi
movl %r14d, %esi
callq 0x47cfe
cmpl $-0x1, %eax
je 0x4826b
movl %eax, %r15d
movq %r12, %rdi
movl %r13d, %esi
callq 0x47cfe
cmpl $-0x1, %eax
je 0x4826b
movl %eax, %r13d
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x47a98
cmpl $-0x1, %eax
je 0x4826b
movslq %ebp, %rcx
cltq
movl %r15d, %edx
movl %r13d, %ebx
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_O3/gplessis[P]dotdeb-redis/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 0x482d0
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq -0x3(%rdx), %rdi
callq 0x382d1
testq %rax, %rax
je 0x482d0
movq %rax, %rbx
leal -0x4(%r14), %ecx
movq %r12, %rdi
movl %r14d, %esi
movq %rax, %rdx
callq 0x27166
testl %eax, %eax
je 0x482d5
movl %eax, %edx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x481dd
movq %rax, %r14
jmp 0x482d8
xorl %r14d, %r14d
jmp 0x482e0
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x38413
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r12
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x47db6
cmpl $-0x1, %eax
je 0x48467
movl %eax, %ebp
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
callq 0x47db6
movl %eax, 0xc(%rsp)
cmpl $-0x1, %eax
je 0x48467
movl %ebp, %r13d
movq %r13, %rdi
callq 0x382d1
movq %rax, %r15
testq %rax, %rax
je 0x4836c
movl 0xc(%rsp), %esi
testb $0x2, %bl
jne 0x48374
xorl %edi, %edi
callq 0x36178
movq %rax, %r14
testq %rax, %rax
jne 0x4837f
movq %r15, %rdi
callq 0x38413
xorl %r14d, %r14d
jmp 0x48452
xorl %r14d, %r14d
jmp 0x48445
movq %rsi, %rdi
callq 0x382d1
movq %rax, %r14
movq %r15, 0x10(%rsp)
movl %ebx, 0x8(%rsp)
testl %ebp, %ebp
je 0x483db
movq 0x10(%rsp), %r15
movq 0x38(%r12), %rax
cmpq %r13, %rax
movq %r13, %rbx
cmovbq %rax, %rbx
testq %rax, %rax
cmoveq %r13, %rbx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *(%r12)
testq %rax, %rax
je 0x4841c
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x483ce
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq *%rax
addq %rbx, %r15
addq %rbx, 0x30(%r12)
subq %rbx, %r13
jne 0x48391
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl 0xc(%rsp), %ecx
callq 0x386fc
testl %eax, %eax
je 0x48427
movq %r15, %rdi
callq 0x38413
testb $0x2, 0x8(%rsp)
jne 0x48467
xorl %edi, %edi
movq %r14, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40650
movl 0x8(%rsp), %ebx
movq 0x10(%rsp), %r15
jmp 0x48445
leaq 0xce562(%rip), %rax     # 0x116990
cmpl $0x0, (%rax)
movl 0x8(%rsp), %ebx
je 0x48445
leaq 0x7a5a6(%rip), %rdi     # 0xc29e4
xorl %eax, %eax
callq 0x80199
movq %r15, %rdi
callq 0x38413
testb $0x2, %bl
jne 0x4845c
movq %r14, %rdi
callq 0x36330
jmp 0x48464
movq %r14, %rdi
callq 0x38413
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq $0xb, %rdx
ja 0x484c6
leaq 0x3(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x48152
testl %eax, %eax
je 0x484f8
movl %eax, %ebx
leaq 0x3(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x47a98
cmpl $-0x1, %eax
movq $-0x1, %r12
cmovneq %rbx, %r12
jmp 0x48537
cmpq $0x15, %rbx
jb 0x484f8
leaq 0xb93d5(%rip), %rax     # 0x1018a8
cmpl $0x0, 0x750(%rax)
je 0x484f8
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4827d
cmpq $-0x1, %rax
je 0x48530
movq %rax, %r12
testq %rax, %rax
jg 0x48537
movq %r14, %rdi
movl %ebx, %esi
callq 0x47cfe
cmpl $-0x1, %eax
je 0x48530
movslq %eax, %r12
testq %rbx, %rbx
je 0x48537
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x47a98
addq %rbx, %r12
cmpl $-0x1, %eax
movq $-0x1, %rax
cmoveq %rax, %r12
jmp 0x48537
movq $-0x1, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveLongLongAsStringObject
ssize_t rdbSaveLongLongAsStringObject(rio *rdb, long long value) {
    unsigned char buf[32];
    ssize_t n, nwritten = 0;
    int enclen = rdbEncodeInteger(value,buf);
    if (enclen > 0) {
        return rdbWriteRaw(rdb,buf,enclen);
    } else {
        /* Encode as string */
        enclen = ll2string((char*)buf,32,value);
        serverAssert(enclen < 32);
        if ((n = rdbSaveLen(rdb,enclen)) == -1) return -1;
        nwritten += n;
        if ((n = rdbWriteRaw(rdb,buf,enclen)) == -1) return -1;
        nwritten += n;
    }
    return nwritten;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rsi
movq %r14, %rdi
callq 0x47f2c
testl %eax, %eax
je 0x48583
movl %eax, %edx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x47a98
movslq %eax, %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x3ff83
cmpl $0x20, %eax
jge 0x485d1
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
callq 0x47cfe
movq $-0x1, %r14
cmpl $-0x1, %eax
je 0x48575
movl %eax, %ebp
movslq %r15d, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x47a98
cmpl $-0x1, %eax
je 0x48575
movslq %ebp, %rcx
movslq %eax, %r14
addq %rcx, %r14
jmp 0x48575
leaq 0x7a42a(%rip), %rdi     # 0xc2a02
leaq 0x7a42f(%rip), %rsi     # 0xc2a0e
movl $0x181, %edx            # imm = 0x181
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveStringObject
int rdbSaveStringObject(rio *rdb, robj *obj) {
    /* Avoid to decode the object, then encode it again, if the
     * object is already integer encoded. */
    if (obj->encoding == OBJ_ENCODING_INT) {
        return rdbSaveLongLongAsStringObject(rdb,(long)obj->ptr);
    } else {
        serverAssertWithInfo(NULL,obj,sdsEncodedObject(obj));
        return rdbSaveRawString(rdb,obj->ptr,sdslen(obj->ptr));
    }
}

// Assembly:
pushq %rax
movl (%rsi), %eax
shrl $0x4, %eax
andl $0xf, %eax
je 0x48613
cmpl $0x8, %eax
je 0x48613
cmpl $0x1, %eax
jne 0x4865a
movq 0x8(%rsi), %rsi
callq 0x48546
jmp 0x48658
movq 0x8(%rsi), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x48651
leaq 0x7a1c0(%rip), %rcx     # 0xc27ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x48653
movq -0x11(%rsi), %rdx
jmp 0x48653
movzwl -0x5(%rsi), %edx
jmp 0x48653
movl -0x9(%rsi), %edx
jmp 0x48653
movzbl -0x3(%rsi), %edx
jmp 0x48653
xorl %edx, %edx
callq 0x48479
popq %rcx
retq
leaq 0x7a3b3(%rip), %rdx     # 0xc2a14
leaq 0x7a3a6(%rip), %rcx     # 0xc2a0e
xorl %edi, %edi
movl $0x191, %r8d            # imm = 0x191
callq 0x627c3
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbGenericLoadStringObject
void *rdbGenericLoadStringObject(rio *rdb, int flags) {
    int encode = flags & RDB_LOAD_ENC;
    int plain = flags & RDB_LOAD_PLAIN;
    int isencoded;
    uint32_t len;

    len = rdbLoadLen(rdb,&isencoded);
    if (isencoded) {
        switch(len) {
        case RDB_ENC_INT8:
        case RDB_ENC_INT16:
        case RDB_ENC_INT32:
            return rdbLoadIntegerObject(rdb,len,flags);
        case RDB_ENC_LZF:
            return rdbLoadLzfStringObject(rdb,flags);
        default:
            rdbExitReportCorruptRDB("Unknown RDB string encoding type %d",len);
        }
    }

    if (len == RDB_LENERR) return NULL;
    if (!plain) {
        robj *o = encode ? createStringObject(NULL,len) :
                           createRawStringObject(NULL,len);
        if (len && rioRead(rdb,o->ptr,len) == 0) {
            decrRefCount(o);
            return NULL;
        }
        return o;
    } else {
        void *buf = zmalloc(len);
        if (len && rioRead(rdb,buf,len) == 0) {
            zfree(buf);
            return NULL;
        }
        return buf;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x4(%rsp), %r15
movq %r15, %rsi
callq 0x47db6
movl %eax, %ebp
cmpl $0x0, (%r15)
je 0x486b9
cmpl $0x3, %ebp
jae 0x486dd
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0x47f93
jmp 0x486ee
cmpl $-0x1, %ebp
je 0x487bc
movl %ebp, %r15d
testb $0x2, %r14b
jne 0x486f6
xorl %edi, %edi
movq %r15, %rsi
testb $0x1, %r14b
jne 0x48753
callq 0x4068b
jmp 0x48758
jne 0x487d1
movq %rbx, %rdi
movl %r14d, %esi
callq 0x482ef
movq %rax, %r14
jmp 0x487bf
movq %r15, %rdi
callq 0x382d1
movq %rax, %r14
testl %ebp, %ebp
je 0x487bf
movq %r14, %r12
movq 0x38(%rbx), %rax
cmpq %r15, %rax
movq %r15, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %r15, %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *(%rbx)
testq %rax, %rax
je 0x487aa
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x48745
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r12
addq %r13, 0x30(%rbx)
subq %r13, %r15
jne 0x4870c
jmp 0x487bf
callq 0x40744
movq %rax, %r14
testl %ebp, %ebp
je 0x487bf
movq 0x8(%r14), %r12
movq 0x38(%rbx), %rax
cmpq %r15, %rax
movq %r15, %r13
cmovbq %rax, %r13
testq %rax, %rax
cmoveq %r15, %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *(%rbx)
testq %rax, %rax
je 0x487b4
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x4879c
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq *%rax
addq %r13, %r12
addq %r13, 0x30(%rbx)
subq %r13, %r15
jne 0x48763
jmp 0x487bf
movq %r14, %rdi
callq 0x38413
jmp 0x487bc
movq %r14, %rdi
callq 0x40c8f
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7a252(%rip), %rsi     # 0xc2a2a
movl $0x1b1, %edi            # imm = 0x1B1
movl %ebp, %edx
xorl %eax, %eax
callq 0x47948
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveDoubleValue
int rdbSaveDoubleValue(rio *rdb, double val) {
    unsigned char buf[128];
    int len;

    if (isnan(val)) {
        buf[0] = 253;
        len = 1;
    } else if (!isfinite(val)) {
        len = 1;
        buf[0] = (val < 0) ? 255 : 254;
    } else {
#if (DBL_MANT_DIG >= 52) && (LLONG_MAX == 0x7fffffffffffffffLL)
        /* Check if the float is in a safe range to be casted into a
         * long long. We are assuming that long long is 64 bit here.
         * Also we are assuming that there are no implementations around where
         * double has precision < 52 bit.
         *
         * Under this assumptions we test if a double is inside an interval
         * where casting to long long is safe. Then using two castings we
         * make sure the decimal part is zero. If all this is true we use
         * integer printing function that is much faster. */
        double min = -4503599627370495; /* (2^52)-1 */
        double max = 4503599627370496; /* -(2^52) */
        if (val > min && val < max && val == ((double)((long long)val)))
            ll2string((char*)buf+1,sizeof(buf)-1,(long long)val);
        else
#endif
            snprintf((char*)buf+1,sizeof(buf)-1,"%.17g",val);
        buf[0] = strlen((char*)buf+1);
        len = buf[0]+1;
    }
    return rdbWriteRaw(rdb,buf,len);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
ucomisd %xmm0, %xmm0
jp 0x4887d
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jl 0x4883a
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
orb $-0x2, %al
movb %al, (%rsp)
movl $0x1, %edx
jmp 0x48867
leaq 0x1(%rsp), %r14
leaq 0x77769(%rip), %rdx     # 0xbffaf
movl $0x7f, %esi
movq %r14, %rdi
movb $0x1, %al
callq 0x26120
movq %r14, %rdi
callq 0x26500
movb %al, -0x1(%r14)
movzbl %al, %edx
incq %rdx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x47a98
addq $0x88, %rsp
popq %rbx
popq %r14
retq
movb $-0x3, (%rsp)
jmp 0x48833
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbLoadDoubleValue
int rdbLoadDoubleValue(rio *rdb, double *val) {
    char buf[256];
    unsigned char len;

    if (rioRead(rdb,&len,1) == 0) return -1;
    switch(len) {
    case 255: *val = R_NegInf; return 0;
    case 254: *val = R_PosInf; return 0;
    case 253: *val = R_Nan; return 0;
    default:
        if (rioRead(rdb,buf,len) == 0) return -1;
        buf[len] = '\0';
        sscanf(buf, "%lg", val);
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf(%rsp), %r15
movl $0x1, %r13d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x38(%r14), %rax
cmpq %r13, %rax
movq %r13, %r12
cmovbq %rax, %r12
testq %rax, %rax
cmoveq %r13, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%r14)
testq %rax, %rax
je 0x489c2
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x488e8
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%rax
addq %r12, %r15
addq %r12, 0x30(%r14)
subq %r12, %r13
jne 0x488aa
movzbl 0xf(%rsp), %r13d
cmpl $0xfd, %r13d
jg 0x48921
testl %r13d, %r13d
je 0x48991
cmpl $0xfd, %r13d
jne 0x48940
leaq 0xcd63c(%rip), %rax     # 0x115f58
jmp 0x489b8
cmpl $0xfe, %r13d
je 0x489b1
cmpl $0xff, %r13d
jne 0x48940
leaq 0xcd612(%rip), %rax     # 0x115f50
jmp 0x489b8
leaq 0x10(%rsp), %r15
movq 0x38(%r14), %rax
cmpq %r13, %rax
movq %r13, %r12
cmovbq %rax, %r12
testq %rax, %rax
cmoveq %r13, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *(%r14)
testq %rax, %rax
je 0x489c2
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x4897f
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq *%rax
addq %r12, %r15
addq %r12, 0x30(%r14)
subq %r12, %r13
jne 0x48945
movzbl 0xf(%rsp), %r13d
movb $0x0, 0x10(%rsp,%r13)
leaq 0x7a0b0(%rip), %rsi     # 0xc2a4e
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x26290
jmp 0x489c2
leaq 0xcd590(%rip), %rax     # 0x115f48
movsd (%rax), %xmm0
movsd %xmm0, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq