// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x271bf
leaq 0x8(%rbx), %rdx
leaq 0x888(%rbx), %rcx
movl 0x8b8(%rbx), %r8d
leaq 0x42cc0(%rip), %rsi     # 0x92894
movq %rax, %rdi
xorl %eax, %eax
callq 0x2763d
movl 0x30(%rbx), %ecx
testl %ecx, %ecx
jne 0x4fbf7
leaq 0x4252c(%rip), %rsi     # 0x92118
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x10, %cl
je 0x4fc0e
leaq 0x4251e(%rip), %rsi     # 0x92121
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x1, %cl
je 0x4fc25
leaq 0x4250f(%rip), %rsi     # 0x92129
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x2, %cl
je 0x4fc3c
leaq 0x42500(%rip), %rsi     # 0x92131
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x4, %cl
je 0x4fc53
leaq 0x424f0(%rip), %rsi     # 0x92138
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x8, %cl
je 0x4fc6a
leaq 0x424e0(%rip), %rsi     # 0x9213f
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x20, %cl
je 0x4fc81
leaq 0x424cf(%rip), %rsi     # 0x92145
movq %rax, %rdi
callq 0x273bf
movl 0x30(%rbx), %ecx
testb $0x40, %cl
je 0x4fc95
leaq 0x424c3(%rip), %rsi     # 0x92150
movq %rax, %rdi
callq 0x273bf
movslq -0x8(%rax), %rcx
cmpb $0x2c, -0x1(%rcx,%rax)
jne 0x4fca5
movb $0x20, -0x1(%rax,%rcx)
movq 0x850(%rbx), %rdx
testq %rdx, %rdx
je 0x4fcc8
addq $0x8, %rdx
leaq 0x42be5(%rip), %rsi     # 0x928a1
movq %rax, %rdi
xorl %eax, %eax
callq 0x2763d
jmp 0x4fcd9
leaq 0x42bd9(%rip), %rsi     # 0x928a8
movq %rax, %rdi
xorl %eax, %eax
callq 0x2763d
movq 0x858(%rbx), %rdx
movq 0x860(%rbx), %rcx
movq 0x38(%rbx), %r8
cmpq $0x0, 0x8c0(%rbx)
je 0x4fcfe
leaq 0x42bc4(%rip), %r9      # 0x928c0
jmp 0x4fd14
testb $0x10, 0x30(%rbx)
leaq 0x42bb4(%rip), %rsi     # 0x928bd
leaq 0x42bb0(%rip), %r9      # 0x928c0
cmoveq %rsi, %r9
leaq 0x42b90(%rip), %rsi     # 0x928ab
movq %rax, %rdi
xorl %eax, %eax
callq 0x2763d
movq %rax, %rdi
pushq $-0x1
popq %rbp
pushq $0x8
popq %r12
leaq 0x4173a(%rip), %r14     # 0x91470
leaq 0x42b8d(%rip), %r15     # 0x928ca
movl %ebp, %r8d
xorl %esi, %esi
cmpl $0x3fff, %esi           # imm = 0x3FFF
jg 0x4fdde
movl %esi, %eax
cltd
idivl %r12d
cltq
movzbl 0x40(%rbx,%rax), %edx
movl %esi, %ecx
andb $0x7, %cl
movl %edx, %eax
shrl %cl, %eax
movl %esi, %ecx
andl $0x7, %ecx
btl %ecx, %edx
movl %esi, %edx
jb 0x4fd73
movl %r8d, %edx
cmpl $-0x1, %r8d
cmovnel %r8d, %edx
cmpl $-0x1, %edx
je 0x4fdba
cmpl $0x3fff, %esi           # imm = 0x3FFF
je 0x4fd8f
movl %eax, %ecx
andl $0x1, %ecx
jne 0x4fdbc
movl $0x4000, %r13d          # imm = 0x4000
testb $0x1, %al
jne 0x4fd9c
movl %esi, %r13d
cmpl $0x3fff, %esi           # imm = 0x3FFF
cmovnel %esi, %r13d
leal -0x1(%r13), %ecx
cmpl %ecx, %edx
jne 0x4fdc1
movq %r14, %rsi
xorl %eax, %eax
callq 0x2763d
jmp 0x4fdcb
movl %ebp, %edx
movl %esi, %r13d
jmp 0x4fdd0
movq %r15, %rsi
xorl %eax, %eax
callq 0x2763d
movq %rax, %rdi
movl %ebp, %edx
incl %r13d
movl %edx, %r8d
movl %r13d, %esi
jmp 0x4fd42
testb $0x10, 0x30(%rbx)
jne 0x4fdf6
movq %rdi, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x771ab(%rip), %r14     # 0xc6fa8
leaq 0x42acd(%rip), %r15     # 0x928d1
leaq 0x42ad4(%rip), %r12     # 0x928df
xorl %ebx, %ebx
cmpq $0x4000, %rbx           # imm = 0x4000
je 0x4fde4
movq 0x7d0(%r14), %rax
movq 0x28(%rax,%rbx,8), %rcx
movq %r15, %rsi
testq %rcx, %rcx
jne 0x4fe3a
movq 0x20028(%rax,%rbx,8), %rcx
movq %r12, %rsi
testq %rcx, %rcx
je 0x4fe4a
addq $0x8, %rcx
movl %ebx, %edx
xorl %eax, %eax
callq 0x2763d
movq %rax, %rdi
incq %rbx
jmp 0x4fe0d