// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2c0c0
movq %rax, %rdi
movq -0x8(%rbp), %rdx
addq $0x8, %rdx
movq -0x8(%rbp), %rcx
addq $0x888, %rcx            # imm = 0x888
movq -0x8(%rbp), %rax
movl 0x8b8(%rax), %r8d
leaq 0x77a93(%rip), %rsi     # 0xe68bc
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x6ee52
movq -0x18(%rbp), %rdi
leaq 0x772f7(%rip), %rsi     # 0xe6140
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x6ee75
movq -0x18(%rbp), %rdi
leaq 0x772dd(%rip), %rsi     # 0xe6149
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x6ee98
movq -0x18(%rbp), %rdi
leaq 0x772c2(%rip), %rsi     # 0xe6151
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x6eebb
movq -0x18(%rbp), %rdi
leaq 0x772a7(%rip), %rsi     # 0xe6159
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x6eede
movq -0x18(%rbp), %rdi
leaq 0x7728b(%rip), %rsi     # 0xe6160
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6ef01
movq -0x18(%rbp), %rdi
leaq 0x7726f(%rip), %rsi     # 0xe6167
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x6ef24
movq -0x18(%rbp), %rdi
leaq 0x77252(%rip), %rsi     # 0xe616d
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x6ef47
movq -0x18(%rbp), %rdi
leaq 0x7723a(%rip), %rsi     # 0xe6178
callq 0x2c5b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x67ee0
movq %rax, %rcx
movq -0x28(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
jne 0x6ef8c
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x67ee0
movq %rax, %rcx
movq -0x30(%rbp), %rax
subq $0x1, %rcx
movb $0x20, (%rax,%rcx)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x850(%rax)
je 0x6efc1
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x850(%rax), %rdx
addq $0x8, %rdx
leaq 0x77915(%rip), %rsi     # 0xe68c9
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
jmp 0x6efd7
movq -0x18(%rbp), %rdi
leaq 0x77904(%rip), %rsi     # 0xe68d0
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x858(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x860(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpq $0x0, 0x8c0(%rcx)
movb %al, -0x31(%rbp)
jne 0x6f02f
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rdi
movb -0x31(%rbp), %sil
leaq 0x7789b(%rip), %r9      # 0xe68e5
leaq 0x77897(%rip), %rax     # 0xe68e8
testb $0x1, %sil
cmovneq %rax, %r9
leaq 0x77873(%rip), %rsi     # 0xe68d3
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xc(%rbp)
cmpl $0x4000, -0xc(%rbp)     # imm = 0x4000
jge 0x6f133
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x6dc60
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
je 0x6f0a8
cmpl $-0x1, -0x10(%rbp)
jne 0x6f0a6
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x6f0a8
cmpl $-0x1, -0x10(%rbp)
je 0x6f123
cmpl $0x0, -0x1c(%rbp)
je 0x6f0bd
cmpl $0x3fff, -0xc(%rbp)     # imm = 0x3FFF
jne 0x6f123
cmpl $0x0, -0x1c(%rbp)
je 0x6f0d5
cmpl $0x3fff, -0xc(%rbp)     # imm = 0x3FFF
jne 0x6f0d5
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6f0fd
movq -0x18(%rbp), %rdi
movl -0x10(%rbp), %edx
leaq 0x76418(%rip), %rsi     # 0xe5508
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
jmp 0x6f11c
movq -0x18(%rbp), %rdi
movl -0x10(%rbp), %edx
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
leaq 0x777e1(%rip), %rsi     # 0xe68f2
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
jmp 0x6f125
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x6f079
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x6f212
movl $0x0, -0xc(%rbp)
cmpl $0x4000, -0xc(%rbp)     # imm = 0x4000
jge 0x6f210
leaq 0xa4797(%rip), %rax     # 0x1138f8
movq 0x7d0(%rax), %rax
movslq -0xc(%rbp), %rcx
cmpq $0x0, 0x28(%rax,%rcx,8)
je 0x6f1aa
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0xa4776(%rip), %rax     # 0x1138f8
movq 0x7d0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq 0x28(%rax,%rcx,8), %rcx
addq $0x8, %rcx
leaq 0x7775c(%rip), %rsi     # 0xe68f9
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
jmp 0x6f200
leaq 0xa4747(%rip), %rax     # 0x1138f8
movq 0x7d0(%rax), %rax
movslq -0xc(%rbp), %rcx
cmpq $0x0, 0x20028(%rax,%rcx,8)
je 0x6f1fe
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0xa4723(%rip), %rax     # 0x1138f8
movq 0x7d0(%rax), %rax
movslq -0xc(%rbp), %rcx
movq 0x20028(%rax,%rcx,8), %rcx
addq $0x8, %rcx
leaq 0x77714(%rip), %rsi     # 0xe6907
movb $0x0, %al
callq 0x2cad0
movq %rax, -0x18(%rbp)
jmp 0x6f200
jmp 0x6f202
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x6f14d
jmp 0x6f212
movq -0x18(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)