// File: /workspace/github_c_makefile_star2_O1/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 0x281b2
leaq 0x8(%rbx), %rdx
leaq 0x888(%rbx), %rcx
movl 0x8b8(%rbx), %r8d
leaq 0x48357(%rip), %rsi     # 0x9c894
movq %rax, %rdi
xorl %eax, %eax
callq 0x28760
cmpl $0x0, 0x30(%rbx)
jne 0x5455c
leaq 0x47bc4(%rip), %rsi     # 0x9c118
movq %rax, %rdi
callq 0x283d7
testb $0x10, 0x30(%rbx)
je 0x54571
leaq 0x47bb8(%rip), %rsi     # 0x9c121
movq %rax, %rdi
callq 0x283d7
testb $0x1, 0x30(%rbx)
je 0x54586
leaq 0x47bab(%rip), %rsi     # 0x9c129
movq %rax, %rdi
callq 0x283d7
testb $0x2, 0x30(%rbx)
je 0x5459b
leaq 0x47b9e(%rip), %rsi     # 0x9c131
movq %rax, %rdi
callq 0x283d7
testb $0x4, 0x30(%rbx)
je 0x545b0
leaq 0x47b90(%rip), %rsi     # 0x9c138
movq %rax, %rdi
callq 0x283d7
testb $0x8, 0x30(%rbx)
je 0x545c5
leaq 0x47b82(%rip), %rsi     # 0x9c13f
movq %rax, %rdi
callq 0x283d7
testb $0x20, 0x30(%rbx)
je 0x545da
leaq 0x47b73(%rip), %rsi     # 0x9c145
movq %rax, %rdi
callq 0x283d7
testb $0x40, 0x30(%rbx)
je 0x545ef
leaq 0x47b69(%rip), %rsi     # 0x9c150
movq %rax, %rdi
callq 0x283d7
movslq -0x8(%rax), %rcx
cmpb $0x2c, -0x1(%rcx,%rax)
jne 0x545ff
movb $0x20, -0x1(%rax,%rcx)
movq 0x850(%rbx), %rdx
testq %rdx, %rdx
je 0x54622
addq $0x8, %rdx
leaq 0x4828b(%rip), %rsi     # 0x9c8a1
movq %rax, %rdi
xorl %eax, %eax
callq 0x28760
jmp 0x54633
leaq 0x4827f(%rip), %rsi     # 0x9c8a8
movq %rax, %rdi
xorl %eax, %eax
callq 0x28760
movq 0x858(%rbx), %rdx
movq 0x860(%rbx), %rcx
movq 0x38(%rbx), %r8
cmpq $0x0, 0x8c0(%rbx)
je 0x54658
leaq 0x4826a(%rip), %r9      # 0x9c8c0
jmp 0x5466e
testb $0x10, 0x30(%rbx)
leaq 0x4825a(%rip), %rsi     # 0x9c8bd
leaq 0x48256(%rip), %r9      # 0x9c8c0
cmoveq %rsi, %r9
leaq 0x48236(%rip), %rsi     # 0x9c8ab
movq %rax, %rdi
xorl %eax, %eax
callq 0x28760
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x46de5(%rip), %r14     # 0x9b470
leaq 0x48238(%rip), %r15     # 0x9c8ca
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 0x546be
movl %ebp, %edx
cmpl $-0x1, %ebp
cmovnel %ebp, %edx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $-0x1, %edx
je 0x546df
cmpl $0x3fff, %esi           # imm = 0x3FFF
je 0x546f2
movl %edi, %ecx
andl $0x1, %ecx
je 0x546f2
movl %edx, %ebp
movl %esi, %r12d
leal 0x1(%r12), %esi
cmpl $0x3fff, %r12d          # imm = 0x3FFF
jl 0x54694
jmp 0x5472f
movl $0x4000, %r12d          # imm = 0x4000
testb $0x1, %dil
jne 0x54701
movl %esi, %r12d
cmpl $0x3fff, %esi           # imm = 0x3FFF
cmovnel %esi, %r12d
leal -0x1(%r12), %ecx
movq %rax, %rdi
cmpl %ecx, %edx
jne 0x54723
movq %r14, %rsi
xorl %eax, %eax
callq 0x28760
jmp 0x546e2
movq %r15, %rsi
xorl %eax, %eax
callq 0x28760
jmp 0x546e2
testb $0x10, 0x30(%rbx)
je 0x5478c
leaq 0x7586c(%rip), %r14     # 0xc9fa8
leaq 0x4818e(%rip), %r15     # 0x9c8d1
leaq 0x48195(%rip), %r12     # 0x9c8df
xorl %ebx, %ebx
movq 0x7d0(%r14), %rdx
movq 0x28(%rdx,%rbx,8), %rcx
movq %r15, %rsi
testq %rcx, %rcx
jne 0x54770
movq 0x20028(%rdx,%rbx,8), %rcx
movq %r12, %rsi
testq %rcx, %rcx
je 0x54780
addq $0x8, %rcx
movq %rax, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x28760
incq %rbx
cmpq $0x4000, %rbx           # imm = 0x4000
jne 0x5474c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq