LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterSendMessage
void clusterSendMessage(clusterLink *link, unsigned char *msg, size_t msglen) {
    if (sdslen(link->sndbuf) == 0 && msglen != 0)
        aeCreateFileEvent(server.el,link->fd,AE_WRITABLE,
                    clusterWriteHandler,link);

    link->sndbuf = sdscatlen(link->sndbuf, msg, msglen);
    server.cluster->stats_bus_messages_sent++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x7cf60
cmpq $0x0, %rax
jne 0x810e5
cmpq $0x0, -0x18(%rbp)
je 0x810e5
leaq 0xf7113(%rip), %rax     # 0x1781d8
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %r8
movl $0x2, %edx
leaq -0x120(%rip), %rcx      # 0x80fc0
callq 0x2a8f0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x39040
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq 0xf70cc(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x60088(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x60088(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBroadcastMessage
void clusterBroadcastMessage(void *buf, size_t len) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(server.cluster->nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (!node->link) continue;
        if (node->flags & (CLUSTER_NODE_MYSELF|CLUSTER_NODE_HANDSHAKE))
            continue;
        clusterSendMessage(node->link,buf,len);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xf7091(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2e470
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x811b5
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
jne 0x8118a
jmp 0x8115b
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x30, %eax
cmpl $0x0, %eax
je 0x8119b
jmp 0x8115b
movq -0x28(%rbp), %rax
movq 0x8c8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x81090
jmp 0x8115b
movq -0x18(%rbp), %rdi
callq 0x2e600
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBroadcastPong
void clusterBroadcastPong(int target) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(server.cluster->nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (!node->link) continue;
        if (node == myself || nodeInHandshake(node)) continue;
        if (target == CLUSTER_BROADCAST_LOCAL_SLAVES) {
            int local_slave =
                nodeIsSlave(node) && node->slaveof &&
                (node->slaveof == myself || node->slaveof == myself->slaveof);
            if (!local_slave) continue;
        }
        clusterSendPing(node->link,CLUSTERMSG_TYPE_PONG);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
leaq 0xf6d46(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2e470
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x81594
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
jne 0x814d9
jmp 0x814a6
movq -0x20(%rbp), %rax
cmpq 0x10b67c(%rip), %rax    # 0x18cb60
je 0x814f5
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x814f7
jmp 0x814a6
cmpl $0x1, -0x4(%rbp)
jne 0x8157a
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0x2, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x25(%rbp)
je 0x81562
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x850(%rcx)
movb %al, -0x25(%rbp)
je 0x81562
movq -0x20(%rbp), %rax
movq 0x850(%rax), %rcx
movb $0x1, %al
cmpq 0x10b628(%rip), %rcx    # 0x18cb60
movb %al, -0x26(%rbp)
je 0x8155c
movq -0x20(%rbp), %rax
movq 0x850(%rax), %rax
movq 0x10b611(%rip), %rcx    # 0x18cb60
cmpq 0x850(%rcx), %rax
sete %al
movb %al, -0x26(%rbp)
movb -0x26(%rbp), %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x81578
jmp 0x814a6
jmp 0x8157a
movq -0x20(%rbp), %rax
movq 0x8c8(%rax), %rdi
movl $0x1, %esi
callq 0x80730
jmp 0x814a6
movq -0x10(%rbp), %rdi
callq 0x2e600
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterRequestFailoverAuth
void clusterRequestFailoverAuth(void) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;
    uint32_t totlen;

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST);
    /* If this is a manual failover, set the CLUSTERMSG_FLAG0_FORCEACK bit
     * in the header to communicate the nodes receiving the message that
     * they should authorized the failover even if the master is working. */
    if (server.cluster->mf_end) hdr->mflags[0] |= CLUSTERMSG_FLAG0_FORCEACK;
    totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
    hdr->totlen = htonl(totlen);
    clusterBroadcastMessage(buf,totlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10e0, %rsp           # imm = 0x10E0
leaq -0x10d0(%rbp), %rax
movq %rax, -0x10d8(%rbp)
movq -0x10d8(%rbp), %rdi
movl $0x5, %esi
callq 0x811d0
leaq 0xf6957(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
cmpq $0x0, 0x60058(%rax)
je 0x818a9
movq -0x10d8(%rbp), %rax
movzbl 0x89d(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0x89d(%rax)
movl $0x8a0, -0x10dc(%rbp)   # imm = 0x8A0
movl -0x10dc(%rbp), %edi
callq 0x26b20
movl %eax, %ecx
movq -0x10d8(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq -0x10d0(%rbp), %rdi
movl -0x10dc(%rbp), %eax
movl %eax, %esi
callq 0x81130
addq $0x10e0, %rsp           # imm = 0x10E0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterSendFailoverAuth
void clusterSendFailoverAuth(clusterNode *node) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;
    uint32_t totlen;

    if (!node->link) return;
    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK);
    totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
    hdr->totlen = htonl(totlen);
    clusterSendMessage(node->link,buf,totlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10f0, %rsp           # imm = 0x10F0
movq %rdi, -0x8(%rbp)
leaq -0x10e0(%rbp), %rax
movq %rax, -0x10e8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
jne 0x8191d
jmp 0x8196e
movq -0x10e8(%rbp), %rdi
movl $0x6, %esi
callq 0x811d0
movl $0x8a0, -0x10ec(%rbp)   # imm = 0x8A0
movl -0x10ec(%rbp), %edi
callq 0x26b20
movl %eax, %ecx
movq -0x10e8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x8c8(%rax), %rdi
leaq -0x10e0(%rbp), %rsi
movl -0x10ec(%rbp), %eax
movl %eax, %edx
callq 0x81090
addq $0x10f0, %rsp           # imm = 0x10F0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterSendMFStart
void clusterSendMFStart(clusterNode *node) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;
    uint32_t totlen;

    if (!node->link) return;
    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_MFSTART);
    totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
    hdr->totlen = htonl(totlen);
    clusterSendMessage(node->link,buf,totlen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10f0, %rsp           # imm = 0x10F0
movq %rdi, -0x8(%rbp)
leaq -0x10e0(%rbp), %rax
movq %rax, -0x10e8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
jne 0x819ad
jmp 0x819fe
movq -0x10e8(%rbp), %rdi
movl $0x8, %esi
callq 0x811d0
movl $0x8a0, -0x10ec(%rbp)   # imm = 0x8A0
movl -0x10ec(%rbp), %edi
callq 0x26b20
movl %eax, %ecx
movq -0x10e8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x8c8(%rax), %rdi
leaq -0x10e0(%rbp), %rsi
movl -0x10ec(%rbp), %eax
movl %eax, %edx
callq 0x81090
addq $0x10f0, %rsp           # imm = 0x10F0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterGetSlaveRank
int clusterGetSlaveRank(void) {
    long long myoffset;
    int j, rank = 0;
    clusterNode *master;

    serverAssert(nodeIsSlave(myself));
    master = myself->slaveof;
    if (master == NULL) return 0; /* Never called by slaves without master. */

    myoffset = replicationGetSlaveOffset();
    for (j = 0; j < master->numslaves; j++)
        if (master->slaves[j] != myself &&
            master->slaves[j]->repl_offset > myoffset) rank++;
    return rank;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x18(%rbp)
movq 0x10b13a(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x81a33
jmp 0x81a55
leaq 0xc0898(%rip), %rdi     # 0x1422d2
leaq 0xbfd55(%rip), %rsi     # 0x141796
movl $0xa1a, %edx            # imm = 0xA1A
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq 0x10b104(%rip), %rax    # 0x18cb60
movq 0x850(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x81a77
movl $0x0, -0x4(%rbp)
jmp 0x81aee
callq 0x523d0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x844(%rcx), %eax
jge 0x81ae8
movq -0x20(%rbp), %rax
movq 0x848(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x10b0b0(%rip), %rax    # 0x18cb60
je 0x81adb
movq -0x20(%rbp), %rax
movq 0x848(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x888(%rax), %rax
cmpq -0x10(%rbp), %rax
jle 0x81adb
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x81add
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x81a87
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterFailoverReplaceYourMaster
void clusterFailoverReplaceYourMaster(void) {
    int j;
    clusterNode *oldmaster = myself->slaveof;

    if (nodeIsMaster(myself) || oldmaster == NULL) return;

    /* 1) Turn this node into a master. */
    clusterSetNodeAsMaster(myself);
    replicationUnsetMaster();

    /* 2) Claim all the slots assigned to our master. */
    for (j = 0; j < CLUSTER_SLOTS; j++) {
        if (clusterNodeGetSlotBit(oldmaster,j)) {
            clusterDelSlot(j);
            clusterAddSlot(myself,j);
        }
    }

    /* 3) Update state and save config. */
    clusterUpdateState();
    clusterSaveConfigOrDie(1);

    /* 4) Pong all the other nodes so that they can update the state
     *    accordingly and detect that we switched to master role. */
    clusterBroadcastPong(CLUSTER_BROADCAST_ALL);

    /* 5) If there was a manual failover in progress, clear the state. */
    resetManualFailover();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x10af01(%rip), %rax    # 0x18cb60
movq 0x850(%rax), %rax
movq %rax, -0x10(%rbp)
movq 0x10aeef(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x81c83
cmpq $0x0, -0x10(%rbp)
jne 0x81c85
jmp 0x81cf6
movq 0x10aed4(%rip), %rdi    # 0x18cb60
callq 0x7d8d0
callq 0x51860
movl $0x0, -0x4(%rbp)
cmpl $0x4000, -0x4(%rbp)     # imm = 0x4000
jge 0x81cdb
movq -0x10(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x81d00
cmpl $0x0, %eax
je 0x81cce
movl -0x4(%rbp), %edi
callq 0x7d970
movq 0x10ae9a(%rip), %rdi    # 0x18cb60
movl -0x4(%rbp), %esi
callq 0x7cb70
jmp 0x81cd0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x81c9d
callq 0x81d30
movl $0x1, %edi
callq 0x7cff0
xorl %edi, %edi
callq 0x81480
callq 0x7d670
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterHandleManualFailover
void clusterHandleManualFailover(void) {
    /* Return ASAP if no manual failover is in progress. */
    if (server.cluster->mf_end == 0) return;

    /* If mf_can_start is non-zero, the failover was already triggered so the
     * next steps are performed by clusterHandleSlaveFailover(). */
    if (server.cluster->mf_can_start) return;

    if (server.cluster->mf_master_offset == 0) return; /* Wait for offset... */

    if (server.cluster->mf_master_offset == replicationGetSlaveOffset()) {
        /* Our replication offset matches the master replication offset
         * announced after clients were paused. We can start the failover. */
        server.cluster->mf_can_start = 1;
        serverLog(LL_WARNING,
            "All master replication stream processed, "
            "manual failover can start.");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xf5879(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
cmpq $0x0, 0x60058(%rax)
jne 0x82975
jmp 0x829fd
leaq 0xf585c(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
cmpl $0x0, 0x60070(%rax)
je 0x8298e
jmp 0x829fd
leaq 0xf5843(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
cmpq $0x0, 0x60068(%rax)
jne 0x829a8
jmp 0x829fd
leaq 0xf5829(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x60068(%rax), %rax
movq %rax, -0x8(%rbp)
callq 0x523d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
cmpq %rcx, %rax
jne 0x829fd
leaq 0xf57ff(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl $0x1, 0x60070(%rax)
movl $0x3, %edi
leaq 0xbfb6f(%rip), %rsi     # 0x142565
movb $0x0, %al
callq 0x2fc60
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBeforeSleep
void clusterBeforeSleep(void) {
    /* Handle failover, this is needed when it is likely that there is already
     * the quorum from masters in order to react fast. */
    if (server.cluster->todo_before_sleep & CLUSTER_TODO_HANDLE_FAILOVER)
        clusterHandleSlaveFailover();

    /* Update the cluster state. */
    if (server.cluster->todo_before_sleep & CLUSTER_TODO_UPDATE_STATE)
        clusterUpdateState();

    /* Save the config, possibly using fsync. */
    if (server.cluster->todo_before_sleep & CLUSTER_TODO_SAVE_CONFIG) {
        int fsync = server.cluster->todo_before_sleep &
                    CLUSTER_TODO_FSYNC_CONFIG;
        clusterSaveConfigOrDie(fsync);
    }

    /* Reset our flags (not strictly needed since every single function
     * called for flags set should be able to clear its flag). */
    server.cluster->todo_before_sleep = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xf4fe9(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl 0x60080(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x83209
callq 0x81fe0
leaq 0xf4fc8(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl 0x60080(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x8322a
callq 0x81d30
leaq 0xf4fa7(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl 0x60080(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x83268
leaq 0xf4f8b(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl 0x60080(%rax), %eax
andl $0x8, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x7cff0
leaq 0xf4f69(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl $0x0, 0x60080(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterMastersHaveSlaves
int clusterMastersHaveSlaves(void) {
    dictIterator *di = dictGetSafeIterator(server.cluster->nodes);
    dictEntry *de;
    int slaves = 0;
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (nodeIsSlave(node)) continue;
        slaves += node->numslaves;
    }
    dictReleaseIterator(di);
    return slaves != 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xf4e99(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2e470
movq %rax, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x8339c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x8338a
jmp 0x8335a
movq -0x20(%rbp), %rax
movl 0x844(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x8335a
movq -0x8(%rbp), %rdi
callq 0x2e600
cmpl $0x0, -0x14(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterNodeSetSlotBit
int clusterNodeSetSlotBit(clusterNode *n, int slot) {
    int old = bitmapTestBit(n->slots,slot);
    bitmapSetBit(n->slots,slot);
    if (!old) {
        n->numslots++;
        /* When a master gets its first slot, even if it has no slaves,
         * it gets flagged with MIGRATE_TO, that is, the master is a valid
         * target for replicas migration, if and only if at least one of
         * the other masters has slaves right now.
         *
         * Normally masters are valid targerts of replica migration if:
         * 1. The used to have slaves (but no longer have).
         * 2. They are slaves failing over a master that used to have slaves.
         *
         * However new masters with slots assigned are considered valid
         * migration tagets if the rest of the cluster is not a slave-less.
         *
         * See https://github.com/antirez/redis/issues/3043 for more info. */
        if (n->numslots == 1 && clusterMastersHaveSlaves())
            n->flags |= CLUSTER_NODE_MIGRATE_TO;
    }
    return old;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movl -0xc(%rbp), %esi
callq 0x7f570
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movl -0xc(%rbp), %esi
callq 0x83290
cmpl $0x0, -0x10(%rbp)
jne 0x83434
movq -0x8(%rbp), %rax
movl 0x840(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x840(%rax)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x840(%rax)
jne 0x83432
callq 0x83330
cmpl $0x0, %eax
je 0x83432
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x30(%rax)
jmp 0x83434
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterNodeClearSlotBit
int clusterNodeClearSlotBit(clusterNode *n, int slot) {
    int old = bitmapTestBit(n->slots,slot);
    bitmapClearBit(n->slots,slot);
    if (old) n->numslots--;
    return old;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movl -0xc(%rbp), %esi
callq 0x7f570
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movl -0xc(%rbp), %esi
callq 0x832e0
cmpl $0x0, -0x10(%rbp)
je 0x8348b
movq -0x8(%rbp), %rax
movl 0x840(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x840(%rax)
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: getSlotOrReply
int getSlotOrReply(client *c, robj *o) {
    long long slot;

    if (getLongLongFromObject(o,&slot) != C_OK ||
        slot < 0 || slot >= CLUSTER_SLOTS)
    {
        addReplyError(c,"Invalid or out of range slot");
        return -1;
    }
    return (int) slot;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x49d70
cmpl $0x0, %eax
jne 0x839a3
cmpq $0x0, -0x20(%rbp)
jl 0x839a3
cmpq $0x4000, -0x20(%rbp)    # imm = 0x4000
jl 0x839bc
movq -0x10(%rbp), %rdi
leaq 0xbedeb(%rip), %rsi     # 0x142799
callq 0x42f90
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x839c3
movq -0x20(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: createDumpPayload
void createDumpPayload(rio *payload, robj *o) {
    unsigned char buf[2];
    uint64_t crc;

    /* Serialize the object in a RDB-like format. It consist of an object type
     * byte followed by the serialized object. This is understood by RESTORE. */
    rioInitWithBuffer(payload,sdsempty());
    serverAssert(rdbSaveObjectType(payload,o));
    serverAssert(rdbSaveObject(payload,o));

    /* Write the footer, this is how it looks like:
     * ----------------+---------------------+---------------+
     * ... RDB payload | 2 bytes RDB version | 8 bytes CRC64 |
     * ----------------+---------------------+---------------+
     * RDB version and CRC are both in little endian.
     */

    /* RDB version */
    buf[0] = RDB_VERSION & 0xff;
    buf[1] = (RDB_VERSION >> 8) & 0xff;
    payload->io.buffer.ptr = sdscatlen(payload->io.buffer.ptr,buf,2);

    /* CRC64 */
    crc = crc64(0,(unsigned char*)payload->io.buffer.ptr,
                sdslen(payload->io.buffer.ptr));
    memrev64ifbe(&crc);
    payload->io.buffer.ptr = sdscatlen(payload->io.buffer.ptr,&crc,8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x384f0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x8e5d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x53e50
cmpl $0x0, %eax
je 0x856fd
jmp 0x8571f
leaq 0xbd8b9(%rip), %rdi     # 0x142fbd
leaq 0xbc08b(%rip), %rsi     # 0x141796
movl $0x1135, %edx           # imm = 0x1135
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x540c0
cmpq $0x0, %rax
je 0x85734
jmp 0x85756
leaq 0xbd89f(%rip), %rdi     # 0x142fda
leaq 0xbc054(%rip), %rsi     # 0x141796
movl $0x1136, %edx           # imm = 0x1136
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movb $0x7, -0x12(%rbp)
movb $0x0, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
leaq -0x12(%rbp), %rsi
movl $0x2, %edx
callq 0x39040
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x7cf60
movq -0x30(%rbp), %rsi
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x90130
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
leaq -0x20(%rbp), %rsi
movl $0x8, %edx
callq 0x39040
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: verifyDumpPayload
int verifyDumpPayload(unsigned char *p, size_t len) {
    unsigned char *footer;
    uint16_t rdbver;
    uint64_t crc;

    /* At least 2 bytes of RDB version and 8 of CRC64 should be present. */
    if (len < 10) return C_ERR;
    footer = p+(len-10);

    /* Verify RDB version */
    rdbver = (footer[1] << 8) | footer[0];
    if (rdbver > RDB_VERSION) return C_ERR;

    /* Verify CRC64 */
    crc = crc64(0,p,len-8);
    memrev64ifbe(&crc);
    return (memcmp(&crc,footer+2,8) == 0) ? C_OK : C_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0xa, -0x18(%rbp)
jae 0x85800
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8587e
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl (%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x22(%rbp)
movzwl -0x22(%rbp), %eax
cmpl $0x7, %eax
jle 0x8583d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8587e
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
subq $0x8, %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x90130
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
subq %rcx, %rax
setne %al
movzbl %al, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: dumpCommand
void dumpCommand(client *c) {
    robj *o, *dumpobj;
    rio payload;

    /* Check if the key is here. */
    if ((o = lookupKeyRead(c->db,c->argv[1])) == NULL) {
        addReply(c,shared.nullbulk);
        return;
    }

    /* Create the DUMP encoded representation. */
    createDumpPayload(&payload,o);

    /* Transfer to the client */
    dumpobj = createObject(OBJ_STRING,payload.io.buffer.ptr);
    addReplyBulk(c,dumpobj);
    decrRefCount(dumpobj);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4a6c0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x858d8
movq -0x8(%rbp), %rdi
leaq 0xf3373(%rip), %rax     # 0x178c40
movq 0x50(%rax), %rsi
callq 0x42cc0
jmp 0x8590a
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x856c0
movq -0x40(%rbp), %rsi
xorl %edi, %edi
callq 0x48480
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43630
movq -0x18(%rbp), %rdi
callq 0x48f70
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: migrateCloseSocket
void migrateCloseSocket(robj *host, robj *port) {
    sds name = sdsempty();
    migrateCachedSocket *cs;

    name = sdscatlen(name,host->ptr,sdslen(host->ptr));
    name = sdscatlen(name,":",1);
    name = sdscatlen(name,port->ptr,sdslen(port->ptr));
    cs = dictFetchValue(server.migrate_cached_sockets,name);
    if (!cs) {
        sdsfree(name);
        return;
    }

    close(cs->fd);
    zfree(cs);
    dictDelete(server.migrate_cached_sockets,name);
    sdsfree(name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x384f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7cf60
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x39040
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xc59af(%rip), %rsi     # 0x14b898
movl $0x1, %edx
callq 0x39040
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7cf60
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq %rax, %rdx
callq 0x39040
movq %rax, -0x18(%rbp)
leaq 0xf22a5(%rip), %rax     # 0x1781d8
movq 0x308(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2e280
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x85f59
movq -0x18(%rbp), %rdi
callq 0x38620
jmp 0x85f8d
movq -0x20(%rbp), %rax
movl (%rax), %edi
callq 0x26180
movq -0x20(%rbp), %rdi
callq 0x3afa0
leaq 0xf2264(%rip), %rax     # 0x1781d8
movq 0x308(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2de50
movq -0x18(%rbp), %rdi
callq 0x38620
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: migrateCloseTimedoutSockets
void migrateCloseTimedoutSockets(void) {
    dictIterator *di = dictGetSafeIterator(server.migrate_cached_sockets);
    dictEntry *de;

    while((de = dictNext(di)) != NULL) {
        migrateCachedSocket *cs = dictGetVal(de);

        if ((server.unixtime - cs->last_use_time) > MIGRATE_SOCKET_CACHE_TTL) {
            close(cs->fd);
            zfree(cs);
            dictDelete(server.migrate_cached_sockets,dictGetKey(de));
        }
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xf2229(%rip), %rax     # 0x1781d8
movq 0x308(%rax), %rdi
callq 0x2e470
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x8602a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0xf21f3(%rip), %rax     # 0x1781d8
movq 0x978(%rax), %rax
movq -0x18(%rbp), %rcx
subq 0x10(%rcx), %rax
cmpq $0xa, %rax
jle 0x86028
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x26180
movq -0x18(%rbp), %rdi
callq 0x3afa0
leaq 0xf21c3(%rip), %rax     # 0x1781d8
movq 0x308(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x2de50
jmp 0x85fbf
movq -0x8(%rbp), %rdi
callq 0x2e600
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: askingCommand
void askingCommand(client *c) {
    if (server.cluster_enabled == 0) {
        addReplyError(c,"This instance has cluster support disabled");
        return;
    }
    c->flags |= CLIENT_ASKING;
    addReply(c,shared.ok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xf14b5(%rip), %rax     # 0x1781d8
cmpl $0x0, 0x99c(%rax)
jne 0x86d3e
movq -0x8(%rbp), %rdi
leaq 0xbba7f(%rip), %rsi     # 0x1427b6
callq 0x42f90
jmp 0x86d68
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movl %ecx, 0x98(%rax)
movq -0x8(%rbp), %rdi
leaq 0xf1ee1(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: readonlyCommand
void readonlyCommand(client *c) {
    if (server.cluster_enabled == 0) {
        addReplyError(c,"This instance has cluster support disabled");
        return;
    }
    c->flags |= CLIENT_READONLY;
    addReply(c,shared.ok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xf1455(%rip), %rax     # 0x1781d8
cmpl $0x0, 0x99c(%rax)
jne 0x86d9e
movq -0x8(%rbp), %rdi
leaq 0xbba1f(%rip), %rsi     # 0x1427b6
callq 0x42f90
jmp 0x86dc8
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
orl $0x20000, %ecx          # imm = 0x20000
movl %ecx, 0x98(%rax)
movq -0x8(%rbp), %rdi
leaq 0xf1e81(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterRedirectClient
void clusterRedirectClient(client *c, clusterNode *n, int hashslot, int error_code) {
    if (error_code == CLUSTER_REDIR_CROSS_SLOT) {
        addReplySds(c,sdsnew("-CROSSSLOT Keys in request don't hash to the same slot\r\n"));
    } else if (error_code == CLUSTER_REDIR_UNSTABLE) {
        /* The request spawns mutliple keys in the same slot,
         * but the slot is not "stable" currently as there is
         * a migration or import in progress. */
        addReplySds(c,sdsnew("-TRYAGAIN Multiple keys request during rehashing of slot\r\n"));
    } else if (error_code == CLUSTER_REDIR_DOWN_STATE) {
        addReplySds(c,sdsnew("-CLUSTERDOWN The cluster is down\r\n"));
    } else if (error_code == CLUSTER_REDIR_DOWN_UNBOUND) {
        addReplySds(c,sdsnew("-CLUSTERDOWN Hash slot not served\r\n"));
    } else if (error_code == CLUSTER_REDIR_MOVED ||
               error_code == CLUSTER_REDIR_ASK)
    {
        addReplySds(c,sdscatprintf(sdsempty(),
            "-%s %d %s:%d\r\n",
            (error_code == CLUSTER_REDIR_ASK) ? "ASK" : "MOVED",
            hashslot,n->ip,n->port));
    } else {
        serverPanic("getNodeByQuery() unknown error.");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x873c1
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0xbbfad(%rip), %rdi     # 0x143358
callq 0x38510
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x874d5
cmpl $0x2, -0x18(%rbp)
jne 0x873ec
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0xbbfbb(%rip), %rdi     # 0x143391
callq 0x38510
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x874d3
cmpl $0x5, -0x18(%rbp)
jne 0x87417
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0xbbfcb(%rip), %rdi     # 0x1433cc
callq 0x38510
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x874d1
cmpl $0x6, -0x18(%rbp)
jne 0x87442
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0xbbfc3(%rip), %rdi     # 0x1433ef
callq 0x38510
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x874cf
cmpl $0x4, -0x18(%rbp)
je 0x8744e
cmpl $0x3, -0x18(%rbp)
jne 0x874ab
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x384f0
movq %rax, %rdi
movl -0x18(%rbp), %ecx
leaq 0xbbfbe(%rip), %rdx     # 0x143426
leaq 0xbbfb3(%rip), %rax     # 0x143422
cmpl $0x3, %ecx
cmoveq %rax, %rdx
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %r8
addq $0x890, %r8             # imm = 0x890
movq -0x10(%rbp), %rax
movl 0x8c0(%rax), %r9d
leaq 0xbbf7d(%rip), %rsi     # 0x143413
movb $0x0, %al
callq 0x395b0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x874cd
leaq 0xbbf7a(%rip), %rdi     # 0x14342c
leaq 0xba2dd(%rip), %rsi     # 0x141796
movl $0x143f, %edx           # imm = 0x143F
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x874cf
jmp 0x874d1
jmp 0x874d3
jmp 0x874d5
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/crc16.c
// Function: crc16
uint16_t crc16(const char *buf, int len) {
    int counter;
    uint16_t crc = 0;
    for (counter = 0; counter < len; counter++)
            crc = (crc<<8) ^ crc16tab[((crc>>8) ^ *buf++)&0x00FF];
    return crc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movw $0x0, -0x12(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x876b7
movzwl -0x12(%rbp), %eax
shll $0x8, %eax
movzwl -0x12(%rbp), %ecx
sarl $0x8, %ecx
movq -0x8(%rbp), %rdx
movq %rdx, %rsi
addq $0x1, %rsi
movq %rsi, -0x8(%rbp)
movsbl (%rdx), %edx
xorl %edx, %ecx
andl $0xff, %ecx
movslq %ecx, %rdx
leaq 0xbbdee(%rip), %rcx     # 0x143490
movzwl (%rcx,%rdx,2), %ecx
xorl %ecx, %eax
movw %ax, -0x12(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x87668
movw -0x12(%rbp), %ax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/endianconv.c
// Function: memrev64
void memrev64(void *p) {
    unsigned char *x = p, t;

    t = x[0];
    x[0] = x[7];
    x[7] = t;
    t = x[1];
    x[1] = x[6];
    x[6] = t;
    t = x[2];
    x[2] = x[5];
    x[5] = t;
    t = x[3];
    x[3] = x[4];
    x[4] = t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movb 0x7(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x7(%rax)
movq -0x10(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movb 0x6(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1(%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x6(%rax)
movq -0x10(%rbp), %rax
movb 0x2(%rax), %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movb 0x5(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x2(%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x10(%rbp), %rax
movb 0x3(%rax), %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movb 0x4(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x3(%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/slowlog.c
// Function: slowlogFreeEntry
void slowlogFreeEntry(void *septr) {
    slowlogEntry *se = septr;
    int j;

    for (j = 0; j < se->argc; j++)
        decrRefCount(se->argv[j]);
    zfree(se->argv);
    zfree(se);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x87b86
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x48f70
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x87b5b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3afa0
movq -0x10(%rbp), %rdi
callq 0x3afa0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/slowlog.c
// Function: slowlogPushEntryIfNeeded
void slowlogPushEntryIfNeeded(robj **argv, int argc, long long duration) {
    if (server.slowlog_log_slower_than < 0) return; /* Slowlog disabled */
    if (duration >= server.slowlog_log_slower_than)
        listAddNodeHead(server.slowlog,slowlogCreateEntry(argv,argc,duration));

    /* Remove old entries if needed. */
    while (listLength(server.slowlog) > server.slowlog_max_len)
        listDelNode(server.slowlog,listLast(server.slowlog));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0xf05be(%rip), %rax     # 0x1781d8
cmpq $0x0, 0x408(%rax)
jge 0x87c29
jmp 0x87cb6
movq -0x18(%rbp), %rax
leaq 0xf05a4(%rip), %rcx     # 0x1781d8
cmpq 0x408(%rcx), %rax
jl 0x87c6b
leaq 0xf0594(%rip), %rax     # 0x1781d8
movq 0x3f8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x87870
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x26f30
jmp 0x87c6d
leaq 0xf0564(%rip), %rax     # 0x1781d8
movq 0x3f8(%rax), %rax
movq 0x28(%rax), %rax
leaq 0xf0552(%rip), %rcx     # 0x1781d8
cmpq 0x410(%rcx), %rax
jbe 0x87cb6
leaq 0xf0542(%rip), %rax     # 0x1781d8
movq 0x3f8(%rax), %rdi
leaq 0xf0534(%rip), %rax     # 0x1781d8
movq 0x3f8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x271e0
jmp 0x87c6d
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: sha1hex
void sha1hex(char *digest, char *script, size_t len) {
    SHA1_CTX ctx;
    unsigned char hash[20];
    char *cset = "0123456789abcdef";
    int j;

    SHA1Init(&ctx);
    SHA1Update(&ctx,(unsigned char*)script,len);
    SHA1Final(hash,&ctx);

    for (j = 0; j < 20; j++) {
        digest[j*2] = cset[((hash[j]&0xF0)>>4)];
        digest[j*2+1] = cset[(hash[j]&0xF)];
    }
    digest[40] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0xb3662(%rip), %rax     # 0x13b5f0
movq %rax, -0x98(%rbp)
leaq -0x74(%rbp), %rdi
callq 0x3f9d0
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movl %eax, %edx
leaq -0x74(%rbp), %rdi
callq 0x3fa30
leaq -0x90(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x3fb40
movl $0x0, -0x9c(%rbp)
cmpl $0x14, -0x9c(%rbp)
jge 0x88053
movq -0x98(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movzbl -0x90(%rbp,%rcx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x98(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movzbl -0x90(%rbp,%rcx), %ecx
andl $0xf, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movl -0x9c(%rbp), %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x87fcb
movq -0x8(%rbp), %rax
movb $0x0, 0x28(%rax)
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType
char *redisProtocolToLuaType(lua_State *lua, char* reply) {
    char *p = reply;

    switch(*p) {
    case ':': p = redisProtocolToLuaType_Int(lua,reply); break;
    case '$': p = redisProtocolToLuaType_Bulk(lua,reply); break;
    case '+': p = redisProtocolToLuaType_Status(lua,reply); break;
    case '-': p = redisProtocolToLuaType_Error(lua,reply); break;
    case '*': p = redisProtocolToLuaType_MultiBulk(lua,reply); break;
    }
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
addl $-0x24, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x16, %eax
ja 0x8810e
movq -0x20(%rbp), %rax
leaq 0xbb670(%rip), %rcx     # 0x143718
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x88120
movq %rax, -0x18(%rbp)
jmp 0x8810e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x88190
movq %rax, -0x18(%rbp)
jmp 0x8810e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x88230
movq %rax, -0x18(%rbp)
jmp 0x8810e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x882b0
movq %rax, -0x18(%rbp)
jmp 0x8810e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x88330
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Int
char *redisProtocolToLuaType_Int(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long value;

    string2ll(reply+1,p-reply-1,&value);
    lua_pushnumber(lua,(lua_Number)value);
    return p+2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
subq %rax, %rsi
subq $0x1, %rsi
leaq -0x20(%rbp), %rdx
callq 0x47970
movq -0x8(%rbp), %rdi
cvtsi2sdq -0x20(%rbp), %xmm0
callq 0xad2f0
movq -0x18(%rbp), %rax
addq $0x2, %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Bulk
char *redisProtocolToLuaType_Bulk(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long bulklen;

    string2ll(reply+1,p-reply-1,&bulklen);
    if (bulklen == -1) {
        lua_pushboolean(lua,0);
        return p+2;
    } else {
        lua_pushlstring(lua,p+2,bulklen);
        return p+2+bulklen+2;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
subq %rax, %rsi
subq $0x1, %rsi
leaq -0x28(%rbp), %rdx
callq 0x47970
cmpq $-0x1, -0x28(%rbp)
jne 0x881f6
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xad710
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
jmp 0x8821f
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
movq -0x28(%rbp), %rdx
callq 0xad390
movq -0x20(%rbp), %rax
addq $0x2, %rax
addq -0x28(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Status
char *redisProtocolToLuaType_Status(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');

    lua_newtable(lua);
    lua_pushstring(lua,"ok");
    lua_pushlstring(lua,reply+1,p-reply-1);
    lua_settable(lua,-3);
    return p+2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xad9e0
movq -0x8(%rbp), %rdi
leaq 0xc2d49(%rip), %rsi     # 0x14afb7
callq 0xad410
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
subq $0x1, %rdx
callq 0xad390
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xadc40
movq -0x18(%rbp), %rax
addq $0x2, %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Error
char *redisProtocolToLuaType_Error(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');

    lua_newtable(lua);
    lua_pushstring(lua,"err");
    lua_pushlstring(lua,reply+1,p-reply-1);
    lua_settable(lua,-3);
    return p+2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xad9e0
movq -0x8(%rbp), %rdi
leaq 0xb0b1a(%rip), %rsi     # 0x138e08
callq 0xad410
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x1, %rsi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
subq $0x1, %rdx
callq 0xad390
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xadc40
movq -0x18(%rbp), %rax
addq $0x2, %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_MultiBulk
char *redisProtocolToLuaType_MultiBulk(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long mbulklen;
    int j = 0;

    string2ll(reply+1,p-reply-1,&mbulklen);
    p += 2;
    if (mbulklen == -1) {
        lua_pushboolean(lua,0);
        return p;
    }
    lua_newtable(lua);
    for (j = 0; j < mbulklen; j++) {
        lua_pushnumber(lua,j+1);
        p = redisProtocolToLuaType(lua,p);
        lua_settable(lua,-3);
    }
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
subq %rax, %rsi
subq $0x1, %rsi
leaq -0x28(%rbp), %rdx
callq 0x47970
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
cmpq $-0x1, -0x28(%rbp)
jne 0x883a5
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xad710
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x88408
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xad9e0
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x88400
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm0
callq 0xad2f0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x88070
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xadc40
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x883b9
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)