LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clearNodeFailureIfNeeded
void clearNodeFailureIfNeeded(clusterNode *node) {
    mstime_t now = mstime();

    serverAssert(nodeFailed(node));

    /* For slaves we always clear the FAIL flag if we can contact the
     * node again. */
    if (nodeIsSlave(node) || node->numslots == 0) {
        serverLog(LL_NOTICE,
            "Clear FAIL state for node %.40s: %s is reachable again.",
                node->name,
                nodeIsSlave(node) ? "slave" : "master without slots");
        node->flags &= ~CLUSTER_NODE_FAIL;
        clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
    }

    /* If it is a master and...
     * 1) The FAIL state is old enough.
     * 2) It is yet serving slots from our point of view (not failed over).
     * Apparently no one is going to fix these slots, clear the FAIL flag. */
    if (nodeIsMaster(node) && node->numslots > 0 &&
        (now - node->fail_time) >
        (server.cluster_node_timeout * CLUSTER_FAIL_UNDO_TIME_MULT))
    {
        serverLog(LL_NOTICE,
            "Clear FAIL state for node %.40s: is reachable again and nobody is serving its slots after some time.",
                node->name);
        node->flags &= ~CLUSTER_NODE_FAIL;
        clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2ffce
movq %rax, %r14
movl 0x30(%rbx), %eax
testb $0x8, %al
je 0x66f6c
testb $0x2, %al
jne 0x66ed7
cmpl $0x0, 0x840(%rbx)
jne 0x66f13
leaq 0x60ced(%rip), %rcx     # 0xc7bc2
jmp 0x66ede
leaq 0x61e17(%rip), %rcx     # 0xc8cf5
leaq 0x8(%rbx), %rdx
leaq 0x60ca1(%rip), %rsi     # 0xc7b8a
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
movl 0x30(%rbx), %eax
andl $-0x9, %eax
movl %eax, 0x30(%rbx)
leaq 0x9a9a3(%rip), %rcx     # 0x1018a8
movq 0x9b0(%rcx), %rcx
orl $0x6, 0x60080(%rcx)
testb $0x1, %al
je 0x66f66
cmpl $0x0, 0x840(%rbx)
jle 0x66f66
subq 0x868(%rbx), %r14
leaq 0x9a97a(%rip), %r15     # 0x1018a8
movq 0x9a0(%r15), %rax
addq %rax, %rax
cmpq %rax, %r14
jle 0x66f66
leaq 0x8(%rbx), %rdx
leaq 0x60c8f(%rip), %rsi     # 0xc7bd7
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
andb $-0x9, 0x30(%rbx)
movq 0x9b0(%r15), %rax
orl $0x6, 0x60080(%rax)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x60c06(%rip), %rdi     # 0xc7b79
leaq 0x6079b(%rip), %rsi     # 0xc7715
movl $0x49e, %edx            # imm = 0x49E
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterHandshakeInProgress
int clusterHandshakeInProgress(char *ip, int port) {
    dictIterator *di;
    dictEntry *de;

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

        if (!nodeInHandshake(node)) continue;
        if (!strcasecmp(node->ip,ip) && node->port == port) break;
    }
    dictReleaseIterator(di);
    return de != NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x9a906(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2efe5
movq %rax, %rbx
movq %rax, %rdi
callq 0x2f015
xorl %r15d, %r15d
testq %rax, %rax
je 0x66fff
movq 0x8(%rax), %r12
testb $0x20, 0x30(%r12)
je 0x66fef
leaq 0x890(%r12), %rdi
movq %r14, %rsi
callq 0x262f0
testl %eax, %eax
jne 0x66fef
cmpl %ebp, 0x8c0(%r12)
je 0x66ff9
movq %rbx, %rdi
callq 0x2f015
jmp 0x66fc0
movl $0x1, %r15d
movq %rbx, %rdi
callq 0x2f0dd
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterStartHandshake
int clusterStartHandshake(char *ip, int port) {
    clusterNode *n;
    char norm_ip[NET_IP_STR_LEN];
    struct sockaddr_storage sa;

    /* IP sanity check */
    if (inet_pton(AF_INET,ip,
            &(((struct sockaddr_in *)&sa)->sin_addr)))
    {
        sa.ss_family = AF_INET;
    } else if (inet_pton(AF_INET6,ip,
            &(((struct sockaddr_in6 *)&sa)->sin6_addr)))
    {
        sa.ss_family = AF_INET6;
    } else {
        errno = EINVAL;
        return 0;
    }

    /* Port sanity check */
    if (port <= 0 || port > (65535-CLUSTER_PORT_INCR)) {
        errno = EINVAL;
        return 0;
    }

    /* Set norm_ip as the normalized string representation of the node
     * IP address. */
    memset(norm_ip,0,NET_IP_STR_LEN);
    if (sa.ss_family == AF_INET)
        inet_ntop(AF_INET,
            (void*)&(((struct sockaddr_in *)&sa)->sin_addr),
            norm_ip,NET_IP_STR_LEN);
    else
        inet_ntop(AF_INET6,
            (void*)&(((struct sockaddr_in6 *)&sa)->sin6_addr),
            norm_ip,NET_IP_STR_LEN);

    if (clusterHandshakeInProgress(norm_ip,port)) {
        errno = EAGAIN;
        return 0;
    }

    /* Add the node with a random address (NULL as first argument to
     * createClusterNode()). Everything will be fixed during the
     * handshake. */
    n = createClusterNode(NULL,CLUSTER_NODE_HANDSHAKE|CLUSTER_NODE_MEET);
    memcpy(n->ip,norm_ip,sizeof(n->ip));
    n->port = port;
    clusterAddNode(n);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movl %esi, %ebx
movq %rdi, %r15
leaq 0x34(%rsp), %r14
movl $0x2, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x26160
testl %eax, %eax
je 0x67069
movw $0x2, 0x30(%rsp)
leal -0xd8f0(%rbx), %eax
cmpl $0xffff2711, %eax       # imm = 0xFFFF2711
jb 0x67095
xorps %xmm0, %xmm0
movq %rsp, %rdx
movups %xmm0, 0x1e(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
movl $0x2, %edi
jmp 0x670b8
leaq 0x38(%rsp), %r14
movl $0xa, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x26160
testl %eax, %eax
je 0x67095
movw $0xa, 0x30(%rsp)
movl $0xffff2710, %eax       # imm = 0xFFFF2710
leal (%rbx,%rax), %ecx
cmpl %eax, %ecx
ja 0x670a2
callq 0x26880
movl $0x16, (%rax)
jmp 0x670de
xorps %xmm0, %xmm0
movq %rsp, %rdx
movups %xmm0, 0x1e(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
movl $0xa, %edi
movq %r14, %rsi
movl $0x2e, %ecx
callq 0x26c40
movq %rsp, %rdi
movl %ebx, %esi
callq 0x66f8e
testl %eax, %eax
je 0x670ed
callq 0x26880
movl $0xb, (%rax)
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %edi, %edi
movl $0xa0, %esi
callq 0x657a7
movq %rax, %r14
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm0, 0x890(%rax)
movups %xmm1, 0x8a0(%rax)
movups 0x1e(%rsp), %xmm0
movups %xmm0, 0x8ae(%rax)
movl %ebx, 0x8c0(%rax)
leaq 0x9a77c(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rbx
leaq 0x8(%r14), %rdi
movl $0x28, %esi
callq 0x36178
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2e9b8
movl $0x1, %eax
jmp 0x670e0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: representClusterNodeFlags
sds representClusterNodeFlags(sds ci, uint16_t flags) {
    size_t orig_len = sdslen(ci);
    int i, size = sizeof(redisNodeFlagsTable)/sizeof(struct redisNodeFlags);
    for (i = 0; i < size; i++) {
        struct redisNodeFlags *nodeflag = redisNodeFlagsTable + i;
        if (flags & nodeflag->flag) ci = sdscat(ci, nodeflag->name);
    }
    /* If no flag was added, add the "noflags" special flag. */
    if (sdslen(ci) == orig_len) ci = sdscat(ci,"noflags,");
    sdsIncrLen(ci,-1); /* Remove trailing comma. */
    return ci;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movzbl -0x1(%rdi), %r14d
movl %r14d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x673e8
leaq 0x60061(%rip), %rcx     # 0xc7420
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r14d
jmp 0x673eb
movq -0x11(%rbx), %r14
jmp 0x673eb
movzwl -0x5(%rbx), %r14d
jmp 0x673eb
movl -0x9(%rbx), %r14d
jmp 0x673eb
movzbl -0x3(%rbx), %r14d
jmp 0x673eb
xorl %r14d, %r14d
movl $0x8, %r15d
leaq 0x92918(%rip), %r12     # 0xf9d10
testw %bp, -0x8(%r15,%r12)
je 0x6740f
movq (%r15,%r12), %rsi
movq %rbx, %rdi
callq 0x36b9c
movq %rax, %rbx
addq $0x10, %r15
cmpq $0x78, %r15
jne 0x673f8
movzbl -0x1(%rbx), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x67453
leaq 0x60006(%rip), %rdx     # 0xc7434
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x67455
movq -0x11(%rbx), %rax
jmp 0x67455
movzwl -0x5(%rbx), %eax
jmp 0x67455
movl -0x9(%rbx), %eax
jmp 0x67455
movzbl -0x3(%rbx), %eax
jmp 0x67455
xorl %eax, %eax
cmpq %r14, %rax
jne 0x6746c
leaq 0x61253(%rip), %rsi     # 0xc86b4
movq %rbx, %rdi
callq 0x36b9c
movq %rax, %rbx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x36820
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: nodeUpdateAddressIfNeeded
int nodeUpdateAddressIfNeeded(clusterNode *node, clusterLink *link, int port) {
    char ip[NET_IP_STR_LEN] = {0};

    /* We don't proceed if the link is the same as the sender link, as this
     * function is designed to see if the node link is consistent with the
     * symmetric link that is used to receive PINGs from the node.
     *
     * As a side effect this function never frees the passed 'link', so
     * it is safe to call during packet processing. */
    if (link == node->link) return 0;

    nodeIp2String(ip,link);
    if (node->port == port && strcmp(ip,node->ip) == 0) return 0;

    /* IP / port is different, update it. */
    memcpy(node->ip,ip,sizeof(ip));
    node->port = port;
    if (node->link) freeClusterLink(node->link);
    node->flags &= ~CLUSTER_NODE_NOADDR;
    serverLog(LL_WARNING,"Address updated for node %.40s, now %s:%d",
        node->name, node->ip, node->port);

    /* Check if this is our master and we have to change the
     * replication target as well. */
    if (nodeIsSlave(myself) && myself->slaveof == node)
        replicationSetMaster(node->ip, node->port);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x1e(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
cmpq %rsi, 0x8c8(%rdi)
je 0x6758f
movl %edx, %ebp
movq %rdi, %rbx
movl 0x8(%rsi), %edi
xorl %r14d, %r14d
movq %rsp, %rsi
movl $0x2e, %edx
xorl %ecx, %ecx
callq 0x2e279
cmpl %ebp, 0x8c0(%rbx)
jne 0x674fb
leaq 0x890(%rbx), %rsi
movq %rsp, %rdi
callq 0x268f0
testl %eax, %eax
je 0x67592
leaq 0x890(%rbx), %r15
movups 0x1e(%rsp), %xmm0
movups %xmm0, 0x8ae(%rbx)
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm1, 0x8a0(%rbx)
movups %xmm0, 0x890(%rbx)
movl %ebp, 0x8c0(%rbx)
movq 0x8c8(%rbx), %rdi
testq %rdi, %rdi
je 0x67542
callq 0x6651c
movl 0x8c0(%rbx), %ebp
andb $-0x41, 0x30(%rbx)
leaq 0x8(%rbx), %rdx
leaq 0x60761(%rip), %rsi     # 0xc7cb2
movl $0x3, %edi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x2fdad
movq 0xaecc6(%rip), %rax     # 0x116230
movl $0x1, %r14d
testb $0x2, 0x30(%rax)
je 0x67592
cmpq %rbx, 0x850(%rax)
jne 0x67592
movl 0x8c0(%rbx), %esi
movq %r15, %rdi
callq 0x46c10
jmp 0x67592
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterSetMaster
void clusterSetMaster(clusterNode *n) {
    serverAssert(n != myself);
    serverAssert(myself->numslots == 0);

    if (nodeIsMaster(myself)) {
        myself->flags &= ~(CLUSTER_NODE_MASTER|CLUSTER_NODE_MIGRATE_TO);
        myself->flags |= CLUSTER_NODE_SLAVE;
        clusterCloseAllSlots();
    } else {
        if (myself->slaveof)
            clusterNodeRemoveSlave(myself->slaveof,myself);
    }
    myself->slaveof = n;
    clusterNodeAddSlave(n,myself);
    replicationSetMaster(n->ip, n->port);
    resetManualFailover();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0xaea99(%rip), %r14     # 0x116230
cmpq %rdi, %r14
je 0x67849
cmpl $0x0, 0x840(%r14)
jne 0x6785e
movq %rdi, %rbx
movl 0x30(%r14), %eax
testb $0x1, %al
jne 0x677d6
movq 0x850(%r14), %rdi
testq %rdi, %rdi
je 0x67818
movq %r14, %rsi
callq 0x668e9
movq 0xaea5c(%rip), %r14     # 0x116230
jmp 0x67818
andl $0xfffffefc, %eax       # imm = 0xFFFFFEFC
orl $0x2, %eax
movl %eax, 0x30(%r14)
leaq 0x9a0bf(%rip), %r15     # 0x1018a8
movq 0x9b0(%r15), %rdi
addq $0x28, %rdi
movl $0x20000, %edx          # imm = 0x20000
xorl %esi, %esi
callq 0x26110
movl $0x20028, %edi          # imm = 0x20028
addq 0x9b0(%r15), %rdi
movl $0x20000, %edx          # imm = 0x20000
xorl %esi, %esi
callq 0x26110
movq %rbx, 0x850(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x658ac
movl 0x8c0(%rbx), %esi
addq $0x890, %rbx            # imm = 0x890
movq %rbx, %rdi
callq 0x46c10
popq %rbx
popq %r14
popq %r15
jmp 0x6612f
leaq 0x60e42(%rip), %rdi     # 0xc8692
leaq 0x5febe(%rip), %rsi     # 0xc7715
movl $0xe3a, %edx            # imm = 0xE3A
jmp 0x67871
leaq 0x60e39(%rip), %rdi     # 0xc869e
leaq 0x5fea9(%rip), %rsi     # 0xc7715
movl $0xe3b, %edx            # imm = 0xE3B
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterDelNodeSlots
int clusterDelNodeSlots(clusterNode *node) {
    int deleted = 0, j;

    for (j = 0; j < CLUSTER_SLOTS; j++) {
        if (clusterNodeGetSlotBit(node,j)) {
            clusterDelSlot(j);
            deleted++;
        }
    }
    return deleted;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %ebp, %ebp
xorl %r14d, %r14d
movl %ebp, %eax
shrl $0x3, %eax
movzbl 0x40(%rbx,%rax), %eax
movl %ebp, %ecx
andl $0x7, %ecx
btl %ecx, %eax
jae 0x6861e
movl %ebp, %edi
callq 0x66373
incl %r14d
incl %ebp
cmpl $0x4000, %ebp           # imm = 0x4000
jne 0x68600
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterSendUpdate
void clusterSendUpdate(clusterLink *link, clusterNode *node) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;

    if (link == NULL) return;
    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_UPDATE);
    memcpy(hdr->data.update.nodecfg.nodename,node->name,CLUSTER_NAMELEN);
    hdr->data.update.nodecfg.configEpoch = htonu64(node->configEpoch);
    memcpy(hdr->data.update.nodecfg.slots,node->slots,sizeof(node->slots));
    clusterSendMessage(link,buf,ntohl(hdr->totlen));
}

// Assembly:
testq %rdi, %rdi
je 0x686c6
pushq %r15
pushq %r14
pushq %rbx
subq $0x10d0, %rsp           # imm = 0x10D0
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x7, %esi
callq 0x68b27
movq 0x28(%r15), %rax
movq %rax, 0x8c8(%r14)
movups 0x8(%r15), %xmm0
movups 0x18(%r15), %xmm1
movups %xmm1, 0x8b8(%r14)
movups %xmm0, 0x8a8(%r14)
movq 0x38(%r15), %rdi
callq 0x6d177
movq %rax, 0x8a0(%r14)
leaq 0x8d0(%rsp), %rdi
addq $0x40, %r15
movl $0x800, %edx            # imm = 0x800
movq %r15, %rsi
callq 0x26c50
movl 0x4(%r14), %edx
bswapl %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x68a1a
addq $0x10d0, %rsp           # imm = 0x10D0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterWriteHandler
void clusterWriteHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    clusterLink *link = (clusterLink*) privdata;
    ssize_t nwritten;
    UNUSED(el);
    UNUSED(mask);

    nwritten = write(fd, link->sndbuf, sdslen(link->sndbuf));
    if (nwritten <= 0) {
        serverLog(LL_DEBUG,"I/O error writing to node link: %s",
            strerror(errno));
        handleLinkIOError(link);
        return;
    }
    sdsrange(link->sndbuf,nwritten,-1);
    if (sdslen(link->sndbuf) == 0)
        aeDeleteFileEvent(server.el, link->fd, AE_WRITABLE);
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl %esi, %edi
movq 0x10(%rdx), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6897a
leaq 0x5eb37(%rip), %rcx     # 0xc748c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x6897c
movq -0x11(%rsi), %rdx
jmp 0x6897c
movzwl -0x5(%rsi), %edx
jmp 0x6897c
movl -0x9(%rsi), %edx
jmp 0x6897c
movzbl -0x3(%rsi), %edx
jmp 0x6897c
xorl %edx, %edx
callq 0x26bb0
testq %rax, %rax
jle 0x689bd
movq 0x10(%rbx), %rdi
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x377b2
movq 0x10(%rbx), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x68a01
leaq 0x5eaf1(%rip), %rsi     # 0xc74a0
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x689fa
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x5f608(%rip), %rsi     # 0xc7fd8
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movq %rbx, %rdi
popq %rbx
jmp 0x6651c
movq -0x11(%rcx), %rax
jmp 0x689fa
movzwl -0x5(%rcx), %eax
jmp 0x689fa
movl -0x9(%rcx), %eax
jmp 0x689fa
movzbl -0x3(%rcx), %eax
testq %rax, %rax
je 0x68a01
popq %rbx
retq
leaq 0x98ea0(%rip), %rax     # 0x1018a8
movq 0x40(%rax), %rdi
movl 0x8(%rbx), %esi
movl $0x2, %edx
popq %rbx
jmp 0x2cf0e
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movzbl -0x1(%rdi), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x68a66
leaq 0x5ea73(%rip), %rdx     # 0xc74b4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x68a68
movq -0x11(%rdi), %rax
jmp 0x68a68
movzwl -0x5(%rdi), %eax
jmp 0x68a68
movl -0x9(%rdi), %eax
jmp 0x68a68
movzbl -0x3(%rdi), %eax
jmp 0x68a68
xorl %eax, %eax
testq %r14, %r14
je 0x68a98
testq %rax, %rax
jne 0x68a98
leaq 0x98e2f(%rip), %rax     # 0x1018a8
movq 0x40(%rax), %rdi
movl 0x8(%rbx), %esi
leaq -0x151(%rip), %rcx      # 0x68936
movl $0x2, %edx
movq %rbx, %r8
callq 0x2ce46
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x36ad1
movq %rax, 0x10(%rbx)
leaq 0x98dfa(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
incq 0x60088(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x98dd4(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2efe5
movq %rax, %r15
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x68b1a
movq 0x8(%rax), %rax
movq 0x8c8(%rax), %rdi
testq %rdi, %rdi
je 0x68b15
testb $0x30, 0x30(%rax)
jne 0x68b15
movq %r14, %rsi
movq %rbx, %rdx
callq 0x68a1a
movq %r15, %rdi
jmp 0x68aea
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x98be8(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2efe5
movq %rax, %r14
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x68d37
movq 0x8(%rax), %rcx
movq 0x8c8(%rcx), %rdi
testq %rdi, %rdi
je 0x68d32
movq 0xad539(%rip), %rax     # 0x116230
cmpq %rax, %rcx
je 0x68d32
movl 0x30(%rcx), %edx
testb $0x20, %dl
jne 0x68d32
cmpl $0x1, %ebx
jne 0x68d28
testb $0x2, %dl
je 0x68d32
movq 0x850(%rcx), %rcx
testq %rcx, %rcx
je 0x68d32
cmpq %rax, %rcx
je 0x68d28
cmpq 0x850(%rax), %rcx
jne 0x68d32
movl $0x1, %esi
callq 0x6834f
movq %r14, %rdi
jmp 0x68cd6
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/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:
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rsp, %rdi
movl $0x5, %esi
callq 0x68b27
leaq 0x988d5(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
cmpq $0x0, 0x60058(%rax)
je 0x68fec
orb $0x2, 0x89d(%rsp)
movq %rsp, %rdi
movl $0xa0080000, 0x4(%rdi)  # imm = 0xA0080000
movl $0x8a0, %esi            # imm = 0x8A0
callq 0x68ac2
addq $0x10d8, %rsp           # imm = 0x10D8
retq
// File: /workspace/github_c_makefile_star2_O3/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:
cmpq $0x0, 0x8c8(%rdi)
je 0x69055
pushq %r14
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x6, %esi
callq 0x68b27
movl $0xa0080000, 0x4(%r14)  # imm = 0xA0080000
movq 0x8c8(%rbx), %rdi
movl $0x8a0, %edx            # imm = 0x8A0
movq %r14, %rsi
callq 0x68a1a
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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:
cmpq $0x0, 0x8c8(%rdi)
je 0x690a3
pushq %r14
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movl $0x8, %esi
callq 0x68b27
movl $0xa0080000, 0x4(%r14)  # imm = 0xA0080000
movq 0x8c8(%rbx), %rdi
movl $0x8a0, %edx            # imm = 0x8A0
movq %r14, %rsi
callq 0x68a1a
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq 0xad181(%rip), %rax     # 0x116230
testb $0x2, 0x30(%rax)
je 0x69112
movq 0x850(%rax), %r14
xorl %ebx, %ebx
testq %r14, %r14
je 0x69108
callq 0x474eb
movslq 0x844(%r14), %rcx
testq %rcx, %rcx
jle 0x69108
movq 0x848(%r14), %rdx
xorl %esi, %esi
movq 0xad14c(%rip), %rdi     # 0x116230
xorl %ebx, %ebx
movq (%rdx,%rsi,8), %r8
cmpq %rdi, %r8
je 0x69100
xorl %r9d, %r9d
cmpq %rax, 0x888(%r8)
setg %r9b
addl %r9d, %ebx
incq %rsi
cmpq %rsi, %rcx
jne 0x690e6
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5f138(%rip), %rdi     # 0xc8251
leaq 0x5e5f5(%rip), %rsi     # 0xc7715
movl $0xa1a, %edx            # imm = 0xA1A
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterLogCantFailover
void clusterLogCantFailover(int reason) {
    char *msg;
    static time_t lastlog_time = 0;
    mstime_t nolog_fail_time = server.cluster_node_timeout + 5000;

    /* Don't log if we have the same reason for some time. */
    if (reason == server.cluster->cant_failover_reason &&
        time(NULL)-lastlog_time < CLUSTER_CANT_FAILOVER_RELOG_PERIOD)
        return;

    server.cluster->cant_failover_reason = reason;

    /* We also don't emit any log if the master failed no long ago, the
     * goal of this function is to log slaves in a stalled condition for
     * a long time. */
    if (myself->slaveof &&
        nodeFailed(myself->slaveof) &&
        (mstime() - myself->slaveof->fail_time) < nolog_fail_time) return;

    switch(reason) {
    case CLUSTER_CANT_FAILOVER_DATA_AGE:
        msg = "Disconnected from master for longer than allowed. "
              "Please check the 'cluster-slave-validity-factor' configuration "
              "option.";
        break;
    case CLUSTER_CANT_FAILOVER_WAITING_DELAY:
        msg = "Waiting the delay before I can start a new failover.";
        break;
    case CLUSTER_CANT_FAILOVER_EXPIRED:
        msg = "Failover attempt expired.";
        break;
    case CLUSTER_CANT_FAILOVER_WAITING_VOTES:
        msg = "Waiting for votes, but majority still not reached.";
        break;
    default:
        msg = "Unknown reason code.";
        break;
    }
    lastlog_time = time(NULL);
    serverLog(LL_WARNING,"Currently unable to failover: %s", msg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x98768(%rip), %r15     # 0x1018a8
movl $0x1388, %r14d          # imm = 0x1388
addq 0x9a0(%r15), %r14
movl %edi, %ebx
movq 0x9b0(%r15), %rax
cmpl %edi, 0x60050(%rax)
jne 0x6917b
xorl %edi, %edi
callq 0x26cd0
subq 0xad0cc(%rip), %rax     # 0x116238
cmpq $0x12c, %rax            # imm = 0x12C
jl 0x691b9
movq 0x9b0(%r15), %rax
movl %ebx, 0x60050(%rax)
movq 0xad0a8(%rip), %rax     # 0x116230
movq 0x850(%rax), %rax
testq %rax, %rax
je 0x691bf
testb $0x8, 0x30(%rax)
je 0x691bf
callq 0x2ffce
movq 0xad08a(%rip), %rcx     # 0x116230
movq 0x850(%rcx), %rcx
subq 0x868(%rcx), %rax
cmpq %r14, %rax
jge 0x691bf
popq %rbx
popq %r14
popq %r15
retq
decl %ebx
cmpl $0x3, %ebx
ja 0x691d8
movl %ebx, %eax
leaq 0x5e49d(%rip), %rcx     # 0xc766c
movslq (%rcx,%rax,4), %rbx
addq %rcx, %rbx
jmp 0x691df
leaq 0x5f181(%rip), %rbx     # 0xc8360
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0xad04b(%rip)     # 0x116238
leaq 0x5f181(%rip), %rsi     # 0xc8375
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x2fdad
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0xad019(%rip), %rdi     # 0x116230
movq 0x850(%rdi), %r15
testq %r15, %r15
sete %al
orb 0x30(%rdi), %al
testb $0x1, %al
je 0x69237
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x66316
callq 0x46c8e
xorl %ebx, %ebx
leaq 0x9865e(%rip), %r12     # 0x1018a8
movl %ebx, %eax
shrl $0x3, %eax
movzbl 0x40(%r15,%rax), %eax
movl %ebx, %ecx
andl $0x7, %ecx
btl %ecx, %eax
jae 0x6929a
movl %ebx, %edi
callq 0x66373
movq 0x9b0(%r12), %rax
cmpq $0x0, 0x40028(%rax,%rbx,8)
jne 0x6929a
movq 0xacfb0(%rip), %r14     # 0x116230
movq %r14, %rdi
movl %ebx, %esi
callq 0x6a187
movq 0x9b0(%r12), %rax
movq %r14, 0x40028(%rax,%rbx,8)
incq %rbx
cmpq $0x4000, %rbx           # imm = 0x4000
jne 0x6924a
callq 0x692ea
movl $0x1, %edi
callq 0x65cb7
xorl %edi, %edi
callq 0x68cb3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6612f
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
leaq 0x97e17(%rip), %rbx     # 0x1018a8
movq 0x9b0(%rbx), %rax
cmpq $0x0, 0x60058(%rax)
je 0x69aab
cmpl $0x0, 0x60070(%rax)
je 0x69ab3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x60068(%rax), %r14
testq %r14, %r14
je 0x69aab
callq 0x474eb
cmpq %rax, %r14
jne 0x69aab
movq 0x9b0(%rbx), %rax
movl $0x1, 0x60070(%rax)
leaq 0x5ea03(%rip), %rsi     # 0xc84e4
movl $0x3, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2fdad
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
leaq 0x97823(%rip), %rbx     # 0x1018a8
movq 0x9b0(%rbx), %rax
movl 0x60080(%rax), %edi
testb $0x1, %dil
je 0x6a0aa
callq 0x694a5
movq 0x9b0(%rbx), %rax
movl 0x60080(%rax), %edi
testb $0x2, %dil
je 0x6a0c2
callq 0x692ea
movq 0x9b0(%rbx), %rax
movl 0x60080(%rax), %edi
testb $0x4, %dil
je 0x6a0d7
andl $0x8, %edi
callq 0x65cb7
movq 0x9b0(%rbx), %rax
movl $0x0, 0x60080(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
leaq 0x9777e(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x2efe5
movq %rax, %rbx
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x6a176
xorl %r14d, %r14d
movq 0x8(%rax), %rax
testb $0x2, 0x30(%rax)
jne 0x6a15e
addl 0x844(%rax), %r14d
movq %rbx, %rdi
callq 0x2f015
testq %rax, %rax
jne 0x6a14d
xorl %ebp, %ebp
testl %r14d, %r14d
setne %bpl
jmp 0x6a178
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2f0dd
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
pushq %rax
leal 0x7(%rsi), %eax
testl %esi, %esi
cmovnsl %esi, %eax
sarl $0x3, %eax
cltq
movzbl 0x40(%rdi,%rax), %ecx
andb $0x7, %sil
movl %ecx, %edx
btsl %esi, %edx
movzbl %sil, %esi
xorl %ebp, %ebp
btl %esi, %ecx
setb %bpl
movb %dl, 0x40(%rdi,%rax)
jb 0x6a1db
movq %rdi, %rbx
movl 0x840(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x840(%rdi)
testl %eax, %eax
jne 0x6a1db
callq 0x6a11f
testl %eax, %eax
je 0x6a1db
orb $0x1, 0x31(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3628d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x726a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x489d6
testl %eax, %eax
je 0x6b895
movq %rbx, %rdi
movq %r14, %rsi
callq 0x48b30
testq %rax, %rax
je 0x6b8aa
leaq 0xe(%rsp), %rsi
movw $0x7, (%rsi)
movq 0x40(%rbx), %rdi
movl $0x2, %edx
callq 0x36ad1
movq %rax, 0x40(%rbx)
movzbl -0x1(%rax), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x6b867
leaq 0x5bcea(%rip), %rsi     # 0xc752c
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x6b869
movq -0x11(%rax), %rdx
jmp 0x6b869
movzwl -0x5(%rax), %edx
jmp 0x6b869
movl -0x9(%rax), %edx
jmp 0x6b869
movzbl -0x3(%rax), %edx
jmp 0x6b869
xorl %edx, %edx
xorl %edi, %edi
movq %rax, %rsi
callq 0x73840
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq 0x40(%rbx), %rdi
movl $0x8, %edx
callq 0x36ad1
movq %rax, 0x40(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x5d6a0(%rip), %rdi     # 0xc8f3c
leaq 0x5be72(%rip), %rsi     # 0xc7715
movl $0x1135, %edx           # imm = 0x1135
jmp 0x6b8bd
leaq 0x5d6a8(%rip), %rdi     # 0xc8f59
leaq 0x5be5d(%rip), %rsi     # 0xc7715
movl $0x1136, %edx           # imm = 0x1136
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/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:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0xa, %rsi
jb 0x6b911
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpw $0x7, -0xa(%rdi,%rsi)
ja 0x6b90a
leaq -0x8(%rbx), %rdx
xorl %edi, %edi
movq %r14, %rsi
callq 0x73840
movq %rax, %rcx
movq %rax, (%rsp)
xorl %eax, %eax
cmpq -0x8(%r14,%rbx), %rcx
setne %al
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41acf
testq %rax, %rax
je 0x6b969
movq %rsp, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x6b7cd
movq 0x40(%r14), %rsi
xorl %edi, %edi
callq 0x40650
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d170
movq %r14, %rdi
callq 0x40c8f
addq $0x68, %rsp
popq %rbx
popq %r14
retq
leaq 0x969a0(%rip), %rax     # 0x102310
movq 0x50(%rax), %rsi
movq %rbx, %rdi
addq $0x68, %rsp
popq %rbx
popq %r14
jmp 0x3c854
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3628d
movq 0x8(%r14), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x6be13
leaq 0x5b78e(%rip), %rdi     # 0xc757c
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x6be15
movq -0x11(%rsi), %rdx
jmp 0x6be15
movzwl -0x5(%rsi), %edx
jmp 0x6be15
movl -0x9(%rsi), %edx
jmp 0x6be15
movzbl -0x3(%rsi), %edx
jmp 0x6be15
xorl %edx, %edx
movq %rax, %rdi
callq 0x36ad1
leaq 0x5b409(%rip), %rsi     # 0xc722d
movl $0x1, %edx
movq %rax, %rdi
callq 0x36ad1
movq 0x8(%rbx), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x6be6f
leaq 0x5b746(%rip), %rdi     # 0xc7590
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x6be71
movq -0x11(%rsi), %rdx
jmp 0x6be71
movzwl -0x5(%rsi), %edx
jmp 0x6be71
movl -0x9(%rsi), %edx
jmp 0x6be71
movzbl -0x3(%rsi), %edx
jmp 0x6be71
xorl %edx, %edx
movq %rax, %rdi
callq 0x36ad1
movq %rax, %rbx
leaq 0x95a25(%rip), %r15     # 0x1018a8
movq 0x308(%r15), %rdi
movq %rax, %rsi
callq 0x2ef19
testq %rax, %rax
je 0x6beb8
movq %rax, %r14
movl (%rax), %edi
callq 0x26180
movq %r14, %rdi
callq 0x38413
movq 0x308(%r15), %rdi
movq %rbx, %rsi
callq 0x2ecb5
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x36330
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x959d4(%rip), %r12     # 0x1018a8
movq 0x308(%r12), %rdi
callq 0x2efe5
movq %rax, %rbx
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x6bf3a
movq %rax, %r14
movq 0x8(%r14), %r15
movq 0x978(%r12), %rax
subq 0x10(%r15), %rax
cmpq $0xb, %rax
jl 0x6bf2a
movl (%r15), %edi
callq 0x26180
movq %r15, %rdi
callq 0x38413
movq 0x308(%r12), %rdi
movq (%r14), %rsi
callq 0x2ecb5
movq %rbx, %rdi
callq 0x2f015
movq %rax, %r14
testq %rax, %rax
jne 0x6bef4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/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:
leaq 0x94e3a(%rip), %rax     # 0x1018a8
cmpl $0x0, 0x99c(%rax)
je 0x6ca8e
orb $0x2, 0x99(%rdi)
leaq 0x9588b(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
jmp 0x3c854
leaq 0x5bca0(%rip), %rsi     # 0xc8735
jmp 0x3cc06
// File: /workspace/github_c_makefile_star2_O3/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:
leaq 0x94e07(%rip), %rax     # 0x1018a8
cmpl $0x0, 0x99c(%rax)
je 0x6cac1
orb $0x2, 0x9a(%rdi)
leaq 0x95858(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
jmp 0x3c854
leaq 0x5bc6d(%rip), %rsi     # 0xc8735
jmp 0x3cc06
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leal -0x1(%r15), %eax
cmpl $0x5, %eax
ja 0x6cf4e
leaq 0x5a6ff(%rip), %rcx     # 0xc7608
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5c3be(%rip), %rdi     # 0xc92d7
jmp 0x6cf34
leaq 0x5c429(%rip), %rdi     # 0xc934b
jmp 0x6cf34
leaq 0x5c3e5(%rip), %rdi     # 0xc9310
jmp 0x6cf34
leaq 0x5c43a(%rip), %rdi     # 0xc936e
callq 0x362b0
movq %rax, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3ca86
leal -0x3(%r15), %eax
cmpl $0x1, %eax
ja 0x6cf98
callq 0x3628d
cmpl $0x3, %r15d
leaq 0x5c43a(%rip), %rcx     # 0xc93a1
leaq 0x5c437(%rip), %rdx     # 0xc93a5
cmoveq %rcx, %rdx
movl 0x8c0(%r14), %r9d
addq $0x890, %r14            # imm = 0x890
leaq 0x5c40b(%rip), %rsi     # 0xc9392
movq %rax, %rdi
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x36f2d
jmp 0x6cf39
leaq 0x5c40c(%rip), %rdi     # 0xc93ab
leaq 0x5a76f(%rip), %rsi     # 0xc7715
movl $0x143f, %edx           # imm = 0x143F
callq 0x619b4
movl $0x1, %edi
callq 0x263c0