// File: /workspace/github_c_makefile_star2_O3/nilyang[P]redis-tdd-annotation/src/cluster.c
// Function: clusterGenNodeDescription
sds clusterGenNodeDescription(clusterNode *node) {
    int j, start;
    sds ci;

    /* Node coordinates */
    ci = sdscatprintf(sdsempty(),"%.40s %s:%d ",
        node->name,
        node->ip,
        node->port);

    /* Flags */
    if (node->flags == 0) ci = sdscat(ci,"noflags,");
    if (node->flags & REDIS_NODE_MYSELF) ci = sdscat(ci,"myself,");
    if (node->flags & REDIS_NODE_MASTER) ci = sdscat(ci,"master,");
    if (node->flags & REDIS_NODE_SLAVE) ci = sdscat(ci,"slave,");
    if (node->flags & REDIS_NODE_PFAIL) ci = sdscat(ci,"fail?,");
    if (node->flags & REDIS_NODE_FAIL) ci = sdscat(ci,"fail,");
    if (node->flags & REDIS_NODE_HANDSHAKE) ci =sdscat(ci,"handshake,");
    if (node->flags & REDIS_NODE_NOADDR) ci = sdscat(ci,"noaddr,");
    if (ci[sdslen(ci)-1] == ',') ci[sdslen(ci)-1] = ' ';

    /* Slave of... or just "-" */
    if (node->slaveof)
        ci = sdscatprintf(ci,"%.40s ",node->slaveof->name);
    else
        ci = sdscatprintf(ci,"- ");

    /* Latency from the POV of this node, link status */
    ci = sdscatprintf(ci,"%lld %lld %llu %s",
        (long long) node->ping_sent,
        (long long) node->pong_received,
        (unsigned long long) node->configEpoch,
        (node->link || node->flags & REDIS_NODE_MYSELF) ?
                    "connected" : "disconnected");

    /* Slots served by this instance */
    start = -1;
    for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
        int bit;

        if ((bit = clusterNodeGetSlotBit(node,j)) != 0) {
            if (start == -1) start = j;
        }
        if (start != -1 && (!bit || j == REDIS_CLUSTER_SLOTS-1)) {
            if (bit && j == REDIS_CLUSTER_SLOTS-1) j++;

            if (start == j-1) {
                ci = sdscatprintf(ci," %d",start);
            } else {
                ci = sdscatprintf(ci," %d-%d",start,j-1);
            }
            start = -1;
        }
    }

    /* Just for MYSELF node we also dump info about slots that
     * we are migrating to other instances or importing from other
     * instances. */
    if (node->flags & REDIS_NODE_MYSELF) {
        for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
            if (server.cluster->migrating_slots_to[j]) {
                ci = sdscatprintf(ci," [%d->-%.40s]",j,
                    server.cluster->migrating_slots_to[j]->name);
            } else if (server.cluster->importing_slots_from[j]) {
                ci = sdscatprintf(ci," [%d-<-%.40s]",j,
                    server.cluster->importing_slots_from[j]->name);
            }
        }
    }
    return ci;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x2845e
leaq 0x8(%rbx), %rdx
leaq 0x888(%rbx), %rcx
movl 0x8b8(%rbx), %r8d
leaq 0x48944(%rip), %rsi     # 0x9c8d4
movq %rax, %rdi
xorl %eax, %eax
callq 0x28a5e
movl 0x30(%rbx), %ecx
testl %ecx, %ecx
jne 0x53fb3
leaq 0x481b0(%rip), %rsi     # 0x9c158
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x10, %cl
je 0x53fca
leaq 0x481a2(%rip), %rsi     # 0x9c161
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x1, %cl
je 0x53fe1
leaq 0x48193(%rip), %rsi     # 0x9c169
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x2, %cl
je 0x53ff8
leaq 0x48184(%rip), %rsi     # 0x9c171
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x4, %cl
je 0x5400f
leaq 0x48174(%rip), %rsi     # 0x9c178
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x8, %cl
je 0x54026
leaq 0x48164(%rip), %rsi     # 0x9c17f
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x20, %cl
je 0x5403d
leaq 0x48153(%rip), %rsi     # 0x9c185
movq %rax, %rdi
callq 0x286db
movl 0x30(%rbx), %ecx
testb $0x40, %cl
je 0x54051
leaq 0x48147(%rip), %rsi     # 0x9c190
movq %rax, %rdi
callq 0x286db
movslq -0x8(%rax), %rcx
cmpb $0x2c, -0x1(%rcx,%rax)
jne 0x54061
movb $0x20, -0x1(%rax,%rcx)
movq 0x850(%rbx), %rdx
testq %rdx, %rdx
je 0x54084
addq $0x8, %rdx
leaq 0x48869(%rip), %rsi     # 0x9c8e1
movq %rax, %rdi
xorl %eax, %eax
callq 0x28a5e
jmp 0x54095
leaq 0x4885d(%rip), %rsi     # 0x9c8e8
movq %rax, %rdi
xorl %eax, %eax
callq 0x28a5e
movq 0x858(%rbx), %rdx
movq 0x860(%rbx), %rcx
movq 0x38(%rbx), %r8
cmpq $0x0, 0x8c0(%rbx)
je 0x540ba
leaq 0x48848(%rip), %r9      # 0x9c900
jmp 0x540d0
testb $0x10, 0x30(%rbx)
leaq 0x48838(%rip), %rsi     # 0x9c8fd
leaq 0x48834(%rip), %r9      # 0x9c900
cmoveq %rsi, %r9
leaq 0x48814(%rip), %rsi     # 0x9c8eb
movq %rax, %rdi
xorl %eax, %eax
callq 0x28a5e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x473c3(%rip), %r14     # 0x9b4b0
leaq 0x48816(%rip), %r15     # 0x9c90a
xorl %esi, %esi
leal 0x7(%rsi), %ecx
testl %esi, %esi
cmovnsl %esi, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movzbl 0x40(%rbx,%rcx), %edx
movl %esi, %ecx
andb $0x7, %cl
movl %edx, %edi
shrl %cl, %edi
movl %esi, %ecx
andl $0x7, %ecx
btl %ecx, %edx
movl %esi, %edx
jb 0x54120
movl %ebp, %edx
cmpl $-0x1, %ebp
cmovnel %ebp, %edx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %edx
je 0x54141
cmpl $0x3fff, %esi           # imm = 0x3FFF
je 0x54154
movl %edi, %ecx
andl $0x1, %ecx
je 0x54154
movl %edx, %ebp
movl %esi, %r12d
leal 0x1(%r12), %esi
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jl 0x540f6
jmp 0x54191
movl $0x4000, %r12d          # imm = 0x4000
testb $0x1, %dil
jne 0x54163
movl %esi, %r12d
cmpl $0x3fff, %esi           # imm = 0x3FFF
cmovnel %esi, %r12d
leal -0x1(%r12), %ecx
movq %rax, %rdi
cmpl %ecx, %edx
jne 0x54185
movq %r14, %rsi
xorl %eax, %eax
callq 0x28a5e
jmp 0x54144
movq %r15, %rsi
xorl %eax, %eax
callq 0x28a5e
jmp 0x54144
testb $0x10, 0x30(%rbx)
je 0x541ee
leaq 0x75e0a(%rip), %r14     # 0xc9fa8
leaq 0x4876c(%rip), %r15     # 0x9c911
leaq 0x48773(%rip), %r12     # 0x9c91f
xorl %ebx, %ebx
movq 0x7d0(%r14), %rdx
movq 0x28(%rdx,%rbx,8), %rcx
movq %r15, %rsi
testq %rcx, %rcx
jne 0x541d2
movq 0x20028(%rdx,%rbx,8), %rcx
movq %r12, %rsi
testq %rcx, %rcx
je 0x541e2
addq $0x8, %rcx
movq %rax, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x28a5e
incq %rbx
cmpq $0x4000, %rbx           # imm = 0x4000
jne 0x541ae
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq