LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterDelSlot
int clusterDelSlot(int slot) {
    clusterNode *n = server.cluster->slots[slot];

    if (!n) return C_ERR;
    serverAssert(clusterNodeClearSlotBit(n,slot) == 1);
    server.cluster->slots[slot] = NULL;
    return C_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
leaq 0xfa856(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
movq 0x40028(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7d9a9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7da03
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %esi
callq 0x83440
cmpl $0x1, %eax
jne 0x7d9bc
jmp 0x7d9de
leaq 0xc4c6d(%rip), %rdi     # 0x142630
leaq 0xc3dcc(%rip), %rsi     # 0x141796
movl $0xd69, %edx            # imm = 0xD69
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
leaq 0xfa7f3(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
movq $0x0, 0x40028(%rax,%rcx,8)
movl $0x0, -0x4(%rbp)
movl -0x4(%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: clusterDelNode
void clusterDelNode(clusterNode *delnode) {
    int j;
    dictIterator *di;
    dictEntry *de;

    /* 1) Mark slots as unassigned. */
    for (j = 0; j < CLUSTER_SLOTS; j++) {
        if (server.cluster->importing_slots_from[j] == delnode)
            server.cluster->importing_slots_from[j] = NULL;
        if (server.cluster->migrating_slots_to[j] == delnode)
            server.cluster->migrating_slots_to[j] = NULL;
        if (server.cluster->slots[j] == delnode)
            clusterDelSlot(j);
    }

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

        if (node == delnode) continue;
        clusterNodeDelFailureReport(node,delnode);
    }
    dictReleaseIterator(di);

    /* 3) Free the node, unlinking it from the cluster. */
    freeClusterNode(delnode);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x4000, -0xc(%rbp)     # imm = 0x4000
jge 0x7dade
leaq 0xfa7a1(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq 0x20028(%rax,%rcx,8), %rax
cmpq -0x8(%rbp), %rax
jne 0x7da6e
leaq 0xfa781(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq $0x0, 0x20028(%rax,%rcx,8)
leaq 0xfa763(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq 0x28(%rax,%rcx,8), %rax
cmpq -0x8(%rbp), %rax
jne 0x7daa6
leaq 0xfa746(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq $0x0, 0x28(%rax,%rcx,8)
leaq 0xfa72b(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq 0x40028(%rax,%rcx,8), %rax
cmpq -0x8(%rbp), %rax
jne 0x7dace
movl -0xc(%rbp), %edi
callq 0x7d970
jmp 0x7dad0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7da23
leaq 0xfa6f3(%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 0x7db33
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x8(%rbp), %rax
jne 0x7db24
jmp 0x7daf9
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x7e160
jmp 0x7daf9
movq -0x18(%rbp), %rdi
callq 0x2e600
movq -0x8(%rbp), %rdi
callq 0x7e3a0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: createClusterLink
clusterLink *createClusterLink(clusterNode *node) {
    clusterLink *link = zmalloc(sizeof(*link));
    link->ctime = mstime();
    link->sndbuf = sdsempty();
    link->rcvbuf = sdsempty();
    link->node = node;
    link->fd = -1;
    return link;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x28, %edi
callq 0x3acd0
movq %rax, -0x10(%rbp)
callq 0x2ff70
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
callq 0x384f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
callq 0x384f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: freeClusterLink
void freeClusterLink(clusterLink *link) {
    if (link->fd != -1) {
        aeDeleteFileEvent(server.el, link->fd, AE_WRITABLE);
        aeDeleteFileEvent(server.el, link->fd, AE_READABLE);
    }
    sdsfree(link->sndbuf);
    sdsfree(link->rcvbuf);
    if (link->node)
        link->node->link = NULL;
    close(link->fd);
    zfree(link);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x7dc3e
leaq 0xfa5cb(%rip), %rax     # 0x1781d8
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x2, %edx
callq 0x2aab0
leaq 0xfa5af(%rip), %rax     # 0x1781d8
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x1, %edx
callq 0x2aab0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x38620
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x38620
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7dc76
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq $0x0, 0x8c8(%rax)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x26180
movq -0x8(%rbp), %rdi
callq 0x3afa0
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: keyHashSlot
unsigned int keyHashSlot(char *key, int keylen) {
    int s, e; /* start-end indexes of { and } */

    for (s = 0; s < keylen; s++)
        if (key[s] == '{') break;

    /* No '{' ? Hash the whole key. This is the base case. */
    if (s == keylen) return crc16(key,keylen) & 0x3FFF;

    /* '{' found? Check if we have the corresponding '}'. */
    for (e = s+1; e < keylen; e++)
        if (key[e] == '}') break;

    /* No '}' or nothing betweeen {} ? Hash the whole key. */
    if (e == keylen || e == s+1) return crc16(key,keylen) & 0x3FFF;

    /* If we are here there is both a { and a } on its right. Hash
     * what is in the middle between { and }. */
    return crc16(key+s+1,e-s-1) & 0x3FFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7df4e
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7b, %eax
jne 0x7df41
jmp 0x7df4e
jmp 0x7df43
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7df26
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x7df72
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x87650
movzwl %ax, %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x4(%rbp)
jmp 0x7dff9
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7dfa3
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7d, %eax
jne 0x7df96
jmp 0x7dfa3
jmp 0x7df98
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7df7b
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
je 0x7dfb8
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x7dfd1
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x87650
movzwl %ax, %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x4(%rbp)
jmp 0x7dff9
movq -0x10(%rbp), %rdi
movslq -0x18(%rbp), %rax
addq %rax, %rdi
addq $0x1, %rdi
movl -0x1c(%rbp), %esi
subl -0x18(%rbp), %esi
subl $0x1, %esi
callq 0x87650
movzwl %ax, %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterNodeAddFailureReport
int clusterNodeAddFailureReport(clusterNode *failing, clusterNode *sender) {
    list *l = failing->fail_reports;
    listNode *ln;
    listIter li;
    clusterNodeFailReport *fr;

    /* If a failure report from the same sender already exists, just update
     * the timestamp. */
    listRewind(l,&li);
    while ((ln = listNext(&li)) != NULL) {
        fr = ln->value;
        if (fr->node == sender) {
            fr->time = mstime();
            return 0;
        }
    }

    /* Otherwise create a new report. */
    fr = zmalloc(sizeof(*fr));
    fr->node = sender;
    fr->time = mstime();
    listAddNodeTail(l,fr);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8d0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x27320
leaq -0x38(%rbp), %rdi
callq 0x27380
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x7e083
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x7e081
callq 0x2ff70
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7e0c0
jmp 0x7e03c
movl $0x10, %edi
callq 0x3acd0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x27000
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterNodeCleanupFailureReports
void clusterNodeCleanupFailureReports(clusterNode *node) {
    list *l = node->fail_reports;
    listNode *ln;
    listIter li;
    clusterNodeFailReport *fr;
    mstime_t maxtime = server.cluster_node_timeout *
                     CLUSTER_FAIL_REPORT_VALIDITY_MULT;
    mstime_t now = mstime();

    listRewind(l,&li);
    while ((ln = listNext(&li)) != NULL) {
        fr = ln->value;
        if (now - fr->time > maxtime) listDelNode(l,ln);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8d0(%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0xfa0e6(%rip), %rax     # 0x1781d8
movq 0x9a0(%rax), %rax
shlq %rax
movq %rax, -0x38(%rbp)
callq 0x2ff70
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x27320
leaq -0x28(%rbp), %rdi
callq 0x27380
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x7e156
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0x8(%rcx), %rax
cmpq -0x38(%rbp), %rax
jle 0x7e154
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x271e0
jmp 0x7e116
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterNodeDelFailureReport
int clusterNodeDelFailureReport(clusterNode *node, clusterNode *sender) {
    list *l = node->fail_reports;
    listNode *ln;
    listIter li;
    clusterNodeFailReport *fr;

    /* Search for a failure report from this sender. */
    listRewind(l,&li);
    while ((ln = listNext(&li)) != NULL) {
        fr = ln->value;
        if (fr->node == sender) break;
    }
    if (!ln) return 0; /* No failure report from this sender. */

    /* Remove the failure report. */
    listDelNode(l,ln);
    clusterNodeCleanupFailureReports(node);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8d0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x27320
leaq -0x38(%rbp), %rdi
callq 0x27380
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x7e1bc
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0x7e1ba
jmp 0x7e1bc
jmp 0x7e18c
cmpq $0x0, -0x28(%rbp)
jne 0x7e1cc
movl $0x0, -0x4(%rbp)
jmp 0x7e1e9
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x271e0
movq -0x10(%rbp), %rdi
callq 0x7e0d0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
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: clusterNodeRemoveSlave
int clusterNodeRemoveSlave(clusterNode *master, clusterNode *slave) {
    int j;

    for (j = 0; j < master->numslaves; j++) {
        if (master->slaves[j] == slave) {
            if ((j+1) < master->numslaves) {
                int remaining_slaves = (master->numslaves - j) - 1;
                memmove(master->slaves+j,master->slaves+(j+1),
                        (sizeof(*master->slaves) * remaining_slaves));
            }
            master->numslaves--;
            if (master->numslaves == 0)
                master->flags &= ~CLUSTER_NODE_MIGRATE_TO;
            return C_OK;
        }
    }
    return C_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x844(%rcx), %eax
jge 0x7e322
movq -0x10(%rbp), %rax
movq 0x848(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq -0x18(%rbp), %rax
jne 0x7e312
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0x844(%rcx), %eax
jge 0x7e2d9
movq -0x10(%rbp), %rax
movl 0x844(%rax), %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x848(%rax), %rdi
movslq -0x1c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x848(%rax), %rsi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x3, %rax
addq %rax, %rsi
movslq -0x20(%rbp), %rdx
shlq $0x3, %rdx
callq 0x267e0
movq -0x10(%rbp), %rax
movl 0x844(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x844(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x844(%rax)
jne 0x7e309
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
andl $0xfffffeff, %ecx       # imm = 0xFFFFFEFF
movl %ecx, 0x30(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7e329
jmp 0x7e314
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7e247
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterCountNonFailingSlaves
int clusterCountNonFailingSlaves(clusterNode *n) {
    int j, okslaves = 0;

    for (j = 0; j < n->numslaves; j++)
        if (!nodeFailed(n->slaves[j])) okslaves++;
    return okslaves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x844(%rcx), %eax
jge 0x7e399
movq -0x8(%rbp), %rax
movq 0x848(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x30(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x7e38c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7e38e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7e356
movl -0x10(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: freeClusterNode
void freeClusterNode(clusterNode *n) {
    sds nodename;
    int j;

    /* If the node has associated slaves, we have to set
     * all the slaves->slaveof fields to NULL (unknown). */
    for (j = 0; j < n->numslaves; j++)
        n->slaves[j]->slaveof = NULL;

    /* Remove this node from the list of slaves of its master. */
    if (nodeIsSlave(n) && n->slaveof) clusterNodeRemoveSlave(n->slaveof,n);

    /* Unlink from the set of nodes. */
    nodename = sdsnewlen(n->name, CLUSTER_NAMELEN);
    serverAssert(dictDelete(server.cluster->nodes,nodename) == DICT_OK);
    sdsfree(nodename);

    /* Release link and associated data structures. */
    if (n->link) freeClusterLink(n->link);
    listRelease(n->fail_reports);
    zfree(n->slaves);
    zfree(n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x844(%rcx), %eax
jge 0x7e3eb
movq -0x8(%rbp), %rax
movq 0x848(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq $0x0, 0x850(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7e3b3
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x7e41c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x850(%rax)
je 0x7e41c
movq -0x8(%rbp), %rax
movq 0x850(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x7e230
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movl $0x28, %esi
callq 0x38230
movq %rax, -0x10(%rbp)
leaq 0xf9d9f(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2de50
cmpl $0x0, %eax
jne 0x7e454
jmp 0x7e476
leaq 0xc36b6(%rip), %rdi     # 0x141b11
leaq 0xc3334(%rip), %rsi     # 0x141796
movl $0x340, %edx            # imm = 0x340
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x10(%rbp), %rdi
callq 0x38620
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
je 0x7e49d
movq -0x8(%rbp), %rax
movq 0x8c8(%rax), %rdi
callq 0x7dbf0
movq -0x8(%rbp), %rax
movq 0x8d0(%rax), %rdi
callq 0x26ea0
movq -0x8(%rbp), %rax
movq 0x848(%rax), %rdi
callq 0x3afa0
movq -0x8(%rbp), %rdi
callq 0x3afa0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterRenameNode
void clusterRenameNode(clusterNode *node, char *newname) {
    int retval;
    sds s = sdsnewlen(node->name, CLUSTER_NAMELEN);

    serverLog(LL_DEBUG,"Renaming node %.40s into %.40s",
        node->name, newname);
    retval = dictDelete(server.cluster->nodes, s);
    sdsfree(s);
    serverAssert(retval == DICT_OK);
    memcpy(node->name, newname, CLUSTER_NAMELEN);
    clusterAddNode(node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movl $0x28, %esi
callq 0x38230
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
movq -0x10(%rbp), %rcx
xorl %edi, %edi
leaq 0xc363c(%rip), %rsi     # 0x141b47
movb $0x0, %al
callq 0x2fc60
leaq 0xf9cbf(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x2de50
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rdi
callq 0x38620
cmpl $0x0, -0x14(%rbp)
jne 0x7e541
jmp 0x7e563
leaq 0xbd344(%rip), %rdi     # 0x13b88c
leaq 0xc3247(%rip), %rsi     # 0x141796
movl $0x392, %edx            # imm = 0x392
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movl $0x28, %edx
callq 0x26c60
movq -0x8(%rbp), %rdi
callq 0x7ca30
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBumpConfigEpochWithoutConsensus
int clusterBumpConfigEpochWithoutConsensus(void) {
    uint64_t maxEpoch = clusterGetMaxEpoch();

    if (myself->configEpoch == 0 ||
        myself->configEpoch != maxEpoch)
    {
        server.cluster->currentEpoch++;
        myself->configEpoch = server.cluster->currentEpoch;
        clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
                             CLUSTER_TODO_FSYNC_CONFIG);
        serverLog(LL_WARNING,
            "New configEpoch set to %llu",
            (unsigned long long) myself->configEpoch);
        return C_OK;
    } else {
        return C_ERR;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x7cbe0
movq %rax, -0x10(%rbp)
movq 0x10e5b8(%rip), %rax    # 0x18cb60
cmpq $0x0, 0x38(%rax)
je 0x7e5c0
movq 0x10e5aa(%rip), %rax    # 0x18cb60
movq 0x38(%rax), %rax
cmpq -0x10(%rbp), %rax
je 0x7e628
leaq 0xf9c11(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
leaq 0xf9bf7(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x10e56d(%rip), %rax    # 0x18cb60
movq %rcx, 0x38(%rax)
movl $0xc, %edi
callq 0x7db50
movq 0x10e558(%rip), %rax    # 0x18cb60
movq 0x38(%rax), %rdx
movl $0x3, %edi
leaq 0xc354e(%rip), %rsi     # 0x141b66
movb $0x0, %al
callq 0x2fc60
movl $0x0, -0x4(%rbp)
jmp 0x7e62f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterHandleConfigEpochCollision
void clusterHandleConfigEpochCollision(clusterNode *sender) {
    /* Prerequisites: nodes have the same configEpoch and are both masters. */
    if (sender->configEpoch != myself->configEpoch ||
        !nodeIsMaster(sender) || !nodeIsMaster(myself)) return;
    /* Don't act if the colliding node has a smaller Node ID. */
    if (memcmp(sender->name,myself->name,CLUSTER_NAMELEN) <= 0) return;
    /* Get the next ID available at the best of this node knowledge. */
    server.cluster->currentEpoch++;
    myself->configEpoch = server.cluster->currentEpoch;
    clusterSaveConfigOrDie(1);
    serverLog(LL_VERBOSE,
        "WARNING: configEpoch collision with node %.40s."
        " configEpoch set to %llu",
        sender->name,
        (unsigned long long) myself->configEpoch);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10e505(%rip), %rcx    # 0x18cb60
cmpq 0x38(%rcx), %rax
jne 0x7e682
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7e682
movq 0x10e4e9(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x7e687
jmp 0x7e712
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq 0x10e4ca(%rip), %rsi    # 0x18cb60
addq $0x8, %rsi
movl $0x28, %edx
callq 0x269b0
cmpl $0x0, %eax
jg 0x7e6ab
jmp 0x7e712
leaq 0xf9b26(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
leaq 0xf9b0c(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x10e482(%rip), %rax    # 0x18cb60
movq %rcx, 0x38(%rax)
movl $0x1, %edi
callq 0x7cff0
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
movq 0x10e465(%rip), %rax    # 0x18cb60
movq 0x38(%rax), %rcx
movl $0x1, %edi
leaq 0xc3477(%rip), %rsi     # 0x141b82
movb $0x0, %al
callq 0x2fc60
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBlacklistCleanup
void clusterBlacklistCleanup(void) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(server.cluster->nodes_black_list);
    while((de = dictNext(di)) != NULL) {
        int64_t expire = dictGetUnsignedIntegerVal(de);

        if (expire < server.unixtime)
            dictDelete(server.cluster->nodes_black_list,dictGetKey(de));
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xf9aa9(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x20(%rax), %rdi
callq 0x2e470
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x7e796
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
leaq 0xf9a6b(%rip), %rcx     # 0x1781d8
cmpq 0x978(%rcx), %rax
jge 0x7e794
leaq 0xf9a5b(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x2de50
jmp 0x7e743
movq -0x8(%rbp), %rdi
callq 0x2e600
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBlacklistAddNode
void clusterBlacklistAddNode(clusterNode *node) {
    dictEntry *de;
    sds id = sdsnewlen(node->name,CLUSTER_NAMELEN);

    clusterBlacklistCleanup();
    if (dictAdd(server.cluster->nodes_black_list,id,NULL) == DICT_OK) {
        /* If the key was added, duplicate the sds string representation of
         * the key for the next lookup. We'll free it at the end. */
        id = sdsdup(id);
    }
    de = dictFind(server.cluster->nodes_black_list,id);
    dictSetUnsignedIntegerVal(de,time(NULL)+CLUSTER_BLACKLIST_TTL);
    sdsfree(id);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movl $0x28, %esi
callq 0x38230
movq %rax, -0x18(%rbp)
callq 0x7e720
leaq 0xf99fa(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2d8c0
cmpl $0x0, %eax
jne 0x7e808
movq -0x18(%rbp), %rdi
callq 0x38560
movq %rax, -0x18(%rbp)
leaq 0xf99c9(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2dcb0
movq %rax, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq %rax, %rcx
addq $0x3c, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x38620
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterBlacklistExists
int clusterBlacklistExists(char *nodeid) {
    sds id = sdsnewlen(nodeid,CLUSTER_NAMELEN);
    int retval;

    clusterBlacklistCleanup();
    retval = dictFind(server.cluster->nodes_black_list,id) != NULL;
    sdsfree(id);
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x28, %esi
callq 0x38230
movq %rax, -0x10(%rbp)
callq 0x7e720
leaq 0xf995e(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2dcb0
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x38620
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: markNodeAsFailingIfNeeded
void markNodeAsFailingIfNeeded(clusterNode *node) {
    int failures;
    int needed_quorum = (server.cluster->size / 2) + 1;

    if (!nodeTimedOut(node)) return; /* We can reach it. */
    if (nodeFailed(node)) return; /* Already FAILing. */

    failures = clusterNodeFailureReportsCount(node);
    /* Also count myself as a voter if I'm a master. */
    if (nodeIsMaster(myself)) failures++;
    if (failures < needed_quorum) return; /* No weak agreement from masters. */

    serverLog(LL_NOTICE,
        "Marking node %.40s as failing (quorum reached).", node->name);

    /* Mark the node as failing. */
    node->flags &= ~CLUSTER_NODE_PFAIL;
    node->flags |= CLUSTER_NODE_FAIL;
    node->fail_time = mstime();

    /* Broadcast the failing node name to everybody, forcing all the other
     * reachable nodes to flag the node as FAIL. */
    if (nodeIsMaster(myself)) clusterSendFail(node->name);
    clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xf9915(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movl 0x14(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x7e8ef
jmp 0x7e9a5
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x7e903
jmp 0x7e9a5
movq -0x8(%rbp), %rdi
callq 0x7e200
movl %eax, -0xc(%rbp)
movq 0x10e24a(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7e92a
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x7e934
jmp 0x7e9a5
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
movl $0x2, %edi
leaq 0xc3282(%rip), %rsi     # 0x141bca
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $-0x5, %ecx
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x30(%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x868(%rax)
movq 0x10e1dd(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7e99b
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x7e9b0
movl $0x6, %edi
callq 0x7db50
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterSendFail
void clusterSendFail(char *nodename) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAIL);
    memcpy(hdr->data.fail.about.nodename,nodename,CLUSTER_NAMELEN);
    clusterBroadcastMessage(buf,ntohl(hdr->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 -0x10e8(%rbp), %rdi
movl $0x3, %esi
callq 0x811d0
movq -0x10e8(%rbp), %rdi
addq $0x8a0, %rdi            # imm = 0x8A0
movq -0x8(%rbp), %rsi
movl $0x28, %edx
callq 0x26c60
leaq -0x10e0(%rbp), %rax
movq %rax, -0x10f0(%rbp)
movq -0x10e8(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x265c0
movq -0x10f0(%rbp), %rdi
movl %eax, %eax
movl %eax, %esi
callq 0x81130
addq $0x10f0, %rsp           # imm = 0x10F0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2ff70
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x7ea56
jmp 0x7ea78
leaq 0xc319d(%rip), %rdi     # 0x141bfa
leaq 0xc2d32(%rip), %rsi     # 0x141796
movl $0x49e, %edx            # imm = 0x49E
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x7ea94
movq -0x8(%rbp), %rax
cmpl $0x0, 0x840(%rax)
jne 0x7eae5
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
movq -0x8(%rbp), %rax
movl 0x30(%rax), %esi
andl $0x2, %esi
leaq 0xc3196(%rip), %rcx     # 0x141c43
leaq 0xc42c2(%rip), %rax     # 0x142d76
cmpl $0x0, %esi
cmovneq %rax, %rcx
movl $0x2, %edi
leaq 0xc3144(%rip), %rsi     # 0x141c0b
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $-0x9, %ecx
movl %ecx, 0x30(%rax)
movl $0x6, %edi
callq 0x7db50
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7eb58
movq -0x8(%rbp), %rax
cmpl $0x0, 0x840(%rax)
jle 0x7eb58
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
subq 0x868(%rcx), %rax
leaq 0xf96c1(%rip), %rcx     # 0x1781d8
movq 0x9a0(%rcx), %rcx
shlq %rcx
cmpq %rcx, %rax
jle 0x7eb58
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
movl $0x2, %edi
leaq 0xc311e(%rip), %rsi     # 0x141c58
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
andl $-0x9, %ecx
movl %ecx, 0x30(%rax)
movl $0x6, %edi
callq 0x7db50
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0xf9662(%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 0x7ebe6
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x7ebba
jmp 0x7eb8a
movq -0x28(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
movq -0x8(%rbp), %rsi
callq 0x26300
cmpl $0x0, %eax
jne 0x7ebe4
movq -0x28(%rbp), %rax
movl 0x8c0(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x7ebe4
jmp 0x7ebe6
jmp 0x7eb8a
movq -0x18(%rbp), %rdi
callq 0x2e600
cmpq $0x0, -0x20(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
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: 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 %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
addq $0x4, %rdx
movl $0x2, %edi
callq 0x26160
cmpl $0x0, %eax
je 0x7ec4b
movw $0x2, -0xd0(%rbp)
jmp 0x7ec8d
movq -0x10(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
addq $0x8, %rdx
movl $0xa, %edi
callq 0x26160
cmpl $0x0, %eax
je 0x7ec74
movw $0xa, -0xd0(%rbp)
jmp 0x7ec8b
callq 0x26880
movl $0x16, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7ed7a
jmp 0x7ec8d
cmpl $0x0, -0x14(%rbp)
jle 0x7ec9c
cmpl $0xd8ef, -0x14(%rbp)    # imm = 0xD8EF
jle 0x7ecb3
callq 0x26880
movl $0x16, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7ed7a
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x2e, %edx
callq 0x26110
movzwl -0xd0(%rbp), %eax
cmpl $0x2, %eax
jne 0x7ecef
leaq -0xd0(%rbp), %rsi
addq $0x4, %rsi
leaq -0x50(%rbp), %rdx
movl $0x2, %edi
movl $0x2e, %ecx
callq 0x26c50
jmp 0x7ed0d
leaq -0xd0(%rbp), %rsi
addq $0x8, %rsi
leaq -0x50(%rbp), %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x26c50
leaq -0x50(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7eb60
cmpl $0x0, %eax
je 0x7ed32
callq 0x26880
movl $0xb, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x7ed7a
xorl %eax, %eax
movl %eax, %edi
movl $0xa0, %esi
callq 0x7c890
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
leaq -0x50(%rbp), %rsi
movl $0x2e, %edx
callq 0x26c60
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8c0(%rax)
movq -0x20(%rbp), %rdi
callq 0x7ca30
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7cf60
movq %rax, -0x18(%rbp)
movl $0x7, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x7f110
movslq -0x1c(%rbp), %rcx
leaq 0xf81df(%rip), %rax     # 0x1772b0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movzwl -0xa(%rbp), %eax
movq -0x28(%rbp), %rcx
movzwl (%rcx), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x7f103
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x390d0
movq %rax, -0x8(%rbp)
jmp 0x7f105
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7f0be
movq -0x8(%rbp), %rdi
callq 0x7cf60
cmpq -0x18(%rbp), %rax
jne 0x7f133
movq -0x8(%rbp), %rdi
leaq 0xc360b(%rip), %rsi     # 0x142735
callq 0x390d0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x38ce0
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x2e, %edx
callq 0x26110
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8c8(%rcx), %rax
jne 0x7f1c0
movl $0x0, -0x4(%rbp)
jmp 0x7f2ca
leaq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x7f150
movq -0x10(%rbp), %rax
movl 0x8c0(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x7f201
leaq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x890, %rsi            # imm = 0x890
callq 0x268f0
cmpl $0x0, %eax
jne 0x7f201
movl $0x0, -0x4(%rbp)
jmp 0x7f2ca
movq -0x10(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
leaq -0x50(%rbp), %rsi
movl $0x2e, %edx
callq 0x26c60
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8c0(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
je 0x7f245
movq -0x10(%rbp), %rax
movq 0x8c8(%rax), %rdi
callq 0x7dbf0
movq -0x10(%rbp), %rax
movl 0x30(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x30(%rax)
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
movq -0x10(%rbp), %rcx
addq $0x890, %rcx            # imm = 0x890
movq -0x10(%rbp), %rax
movl 0x8c0(%rax), %r8d
movl $0x3, %edi
leaq 0xc2ab7(%rip), %rsi     # 0x141d33
movb $0x0, %al
callq 0x2fc60
movq 0x10d8d6(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x7f2c3
movq 0x10d8c4(%rip), %rax    # 0x18cb60
movq 0x850(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x7f2c3
movq -0x10(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
movq -0x10(%rbp), %rax
movl 0x8c0(%rax), %esi
callq 0x51790
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq 0x10d589(%rip), %rax    # 0x18cb60
je 0x7f5db
jmp 0x7f5fd
leaq 0xc3131(%rip), %rdi     # 0x142713
leaq 0xc21ad(%rip), %rsi     # 0x141796
movl $0xe3a, %edx            # imm = 0xE3A
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq 0x10d55c(%rip), %rax    # 0x18cb60
cmpl $0x0, 0x840(%rax)
jne 0x7f60f
jmp 0x7f631
leaq 0xc3109(%rip), %rdi     # 0x14271f
leaq 0xc2179(%rip), %rsi     # 0x141796
movl $0xe3b, %edx            # imm = 0xE3B
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq 0x10d528(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7f66d
movq 0x10d516(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %ecx
andl $0xfffffefe, %ecx       # imm = 0xFFFFFEFE
movl %ecx, 0x30(%rax)
movq 0x10d503(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x30(%rax)
callq 0x7d4f0
jmp 0x7f69a
movq 0x10d4ec(%rip), %rax    # 0x18cb60
cmpq $0x0, 0x850(%rax)
je 0x7f698
movq 0x10d4db(%rip), %rax    # 0x18cb60
movq 0x850(%rax), %rdi
movq 0x10d4cd(%rip), %rsi    # 0x18cb60
callq 0x7e230
jmp 0x7f69a
movq -0x8(%rbp), %rcx
movq 0x10d4bb(%rip), %rax    # 0x18cb60
movq %rcx, 0x850(%rax)
movq -0x8(%rbp), %rdi
movq 0x10d4a9(%rip), %rsi    # 0x18cb60
callq 0x7ca90
movq -0x8(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
movq -0x8(%rbp), %rax
movl 0x8c0(%rax), %esi
callq 0x51790
callq 0x7d670
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: 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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x4000, -0x10(%rbp)    # imm = 0x4000
jge 0x80af2
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x81d00
cmpl $0x0, %eax
je 0x80ae5
movl -0x10(%rbp), %edi
callq 0x7d970
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x80ae7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x80aba
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x1100, %rsp           # imm = 0x1100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x10e0(%rbp), %rax
movq %rax, -0x10e8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x80b2d
jmp 0x80be3
movq -0x10e8(%rbp), %rdi
movl $0x7, %esi
callq 0x811d0
movq -0x10e8(%rbp), %rdi
addq $0x8a0, %rdi            # imm = 0x8A0
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movl $0x28, %edx
callq 0x26c60
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x87850
movq %rax, %rcx
movq -0x10e8(%rbp), %rax
movq %rcx, 0x8a0(%rax)
movq -0x10e8(%rbp), %rdi
addq $0x8a0, %rdi            # imm = 0x8A0
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
addq $0x40, %rsi
movl $0x800, %edx            # imm = 0x800
callq 0x26c60
movq -0x8(%rbp), %rax
movq %rax, -0x10f8(%rbp)
leaq -0x10e0(%rbp), %rax
movq %rax, -0x10f0(%rbp)
movq -0x10e8(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x265c0
movq -0x10f8(%rbp), %rdi
movq -0x10f0(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x81090
addq $0x1100, %rsp           # imm = 0x1100
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x7cf60
movl -0x3c(%rbp), %edi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x26bc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jg 0x81041
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq %rax, %rdx
xorl %edi, %edi
leaq 0xc102a(%rip), %rsi     # 0x142059
movb $0x0, %al
callq 0x2fc60
movq -0x28(%rbp), %rdi
callq 0x80fa0
jmp 0x81088
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x39db0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x7cf60
cmpq $0x0, %rax
jne 0x81088
leaq 0xf7165(%rip), %rax     # 0x1781d8
movq 0x40(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x2, %edx
callq 0x2aab0
addq $0x40, %rsp
popq %rbp
retq
nop