// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: verifyClusterConfigWithData
int verifyClusterConfigWithData(void) {
    int j;
    int update_config = 0;

    /* If this node is a slave, don't perform the check at all as we
     * completely depend on the replication stream. */
    if (nodeIsSlave(myself)) return C_OK;

    /* Make sure we only have keys in DB0. */
    for (j = 1; j < server.dbnum; j++) {
        if (dictSize(server.db[j].dict)) return C_ERR;
    }

    /* Check that all the slots we see populated memory have a corresponding
     * entry in the cluster table. Otherwise fix the table. */
    for (j = 0; j < CLUSTER_SLOTS; j++) {
        if (!countKeysInSlot(j)) continue; /* No keys in this slot. */
        /* Check if we are assigned to this slot or if we are importing it.
         * In both cases check the next slot as the configuration makes
         * sense. */
        if (server.cluster->slots[j] == myself ||
            server.cluster->importing_slots_from[j] != NULL) continue;

        /* If we are here data and cluster config don't agree, and we have
         * slot 'j' populated even if we are not importing it, nor we are
         * assigned to this slot. Fix this condition. */

        update_config++;
        /* Case A: slot is unassigned. Take responsibility for it. */
        if (server.cluster->slots[j] == NULL) {
            serverLog(LL_WARNING, "I have keys for unassigned slot %d. "
                                    "Taking responsibility for it.",j);
            clusterAddSlot(myself,j);
        } else {
            serverLog(LL_WARNING, "I have keys for slot %d, but the slot is "
                                    "assigned to another node. "
                                    "Setting it to importing state.",j);
            server.cluster->importing_slots_from[j] = server.cluster->slots[j];
        }
    }
    if (update_config) clusterSaveConfigOrDie(1);
    return C_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0xc(%rbp)
movq 0x1096aa(%rip), %rax    # 0x18cb60
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x834cd
movl $0x0, -0x4(%rbp)
jmp 0x83668
movl $0x1, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0xf4cfa(%rip), %rcx     # 0x1781d8
cmpl 0x610(%rcx), %eax
jge 0x8353f
leaq 0xf4ceb(%rip), %rax     # 0x1781d8
movq 0x28(%rax), %rax
movslq -0x8(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
leaq 0xf4cce(%rip), %rcx     # 0x1781d8
movq 0x28(%rcx), %rcx
movslq -0x8(%rbp), %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
addq 0x48(%rcx), %rax
cmpq $0x0, %rax
je 0x83532
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x83668
jmp 0x83534
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x834d4
movl $0x0, -0x8(%rbp)
cmpl $0x4000, -0x8(%rbp)     # imm = 0x4000
jge 0x83651
movl -0x8(%rbp), %edi
callq 0x4d600
cmpl $0x0, %eax
jne 0x83565
jmp 0x83643
leaq 0xf4c6c(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
movq 0x40028(%rax,%rcx,8), %rax
cmpq 0x1095da(%rip), %rax    # 0x18cb60
je 0x835a5
leaq 0xf4c49(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
cmpq $0x0, 0x20028(%rax,%rcx,8)
je 0x835aa
jmp 0x83643
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
leaq 0xf4c1e(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
cmpq $0x0, 0x40028(%rax,%rcx,8)
jne 0x835f7
movl -0x8(%rbp), %edx
movl $0x3, %edi
leaq 0xbf090(%rip), %rsi     # 0x14266f
movb $0x0, %al
callq 0x2fc60
movq 0x109573(%rip), %rdi    # 0x18cb60
movl -0x8(%rbp), %esi
callq 0x7cb70
jmp 0x83641
movl -0x8(%rbp), %edx
movl $0x3, %edi
leaq 0xbf0ab(%rip), %rsi     # 0x1426b1
movb $0x0, %al
callq 0x2fc60
leaq 0xf4bc4(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
movq 0x40028(%rax,%rcx,8), %rdx
leaq 0xf4baa(%rip), %rax     # 0x1781d8
movq 0x9b0(%rax), %rax
movslq -0x8(%rbp), %rcx
movq %rdx, 0x20028(%rax,%rcx,8)
jmp 0x83643
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x83546
cmpl $0x0, -0xc(%rbp)
je 0x83661
movl $0x1, %edi
callq 0x7cff0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)