// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterProcessGossipSection
void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
    uint16_t count = ntohs(hdr->count);
    clusterMsgDataGossip *g = (clusterMsgDataGossip*) hdr->data.ping.gossip;
    clusterNode *sender = link->node ? link->node : clusterLookupNode(hdr->sender);

    while(count--) {
        uint16_t flags = ntohs(g->flags);
        clusterNode *node;
        sds ci;

        if (server.verbosity == LL_DEBUG) {
            ci = representClusterNodeFlags(sdsempty(), flags);
            serverLog(LL_DEBUG,"GOSSIP %.40s %s:%d %s",
                g->nodename,
                g->ip,
                ntohs(g->port),
                ci);
            sdsfree(ci);
        }

        /* Update our state accordingly to the gossip sections */
        node = clusterLookupNode(g->nodename);
        if (node) {
            /* We already know this node.
               Handle failure reports, only when the sender is a master. */
            if (sender && nodeIsMaster(sender) && node != myself) {
                if (flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL)) {
                    if (clusterNodeAddFailureReport(node,sender)) {
                        serverLog(LL_VERBOSE,
                            "Node %.40s reported node %.40s as not reachable.",
                            sender->name, node->name);
                    }
                    markNodeAsFailingIfNeeded(node);
                } else {
                    if (clusterNodeDelFailureReport(node,sender)) {
                        serverLog(LL_VERBOSE,
                            "Node %.40s reported node %.40s is back online.",
                            sender->name, node->name);
                    }
                }
            }

            /* If we already know this node, but it is not reachable, and
             * we see a different address in the gossip section of a node that
             * can talk with this other node, update the address, disconnect
             * the old link if any, so that we'll attempt to connect with the
             * new address. */
            if (node->flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL) &&
                !(flags & CLUSTER_NODE_NOADDR) &&
                !(flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL)) &&
                (strcasecmp(node->ip,g->ip) || node->port != ntohs(g->port)))
            {
                if (node->link) freeClusterLink(node->link);
                memcpy(node->ip,g->ip,NET_IP_STR_LEN);
                node->port = ntohs(g->port);
                node->flags &= ~CLUSTER_NODE_NOADDR;
            }
        } else {
            /* If it's not in NOADDR state and we don't have it, we
             * start a handshake process against this IP/PORT pairs.
             *
             * Note that we require that the sender of this gossip message
             * is a well known node in our cluster, otherwise we risk
             * joining another cluster. */
            if (sender &&
                !(flags & CLUSTER_NODE_NOADDR) &&
                !clusterBlacklistExists(g->nodename))
            {
                clusterStartHandshake(g->ip,ntohs(g->port));
            }
        }

        /* Next node */
        g++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xe(%rax), %edi
callq 0x26580
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rax
addq $0x8a0, %rax            # imm = 0x8A0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7edd8
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x7ede9
movq -0x8(%rbp), %rdi
addq $0x28, %rdi
callq 0x7c820
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movw -0x12(%rbp), %ax
movw %ax, %cx
addw $-0x1, %cx
movw %cx, -0x12(%rbp)
cmpw $0x0, %ax
je 0x7f08a
movq -0x20(%rbp), %rax
movzwl 0x60(%rax), %edi
callq 0x26580
movw %ax, -0x2a(%rbp)
leaq 0xf93b6(%rip), %rax     # 0x1781d8
cmpl $0x0, 0x5f8(%rax)
jne 0x7ee8a
callq 0x384f0
movq %rax, %rdi
movzwl -0x2a(%rbp), %esi
callq 0x7f090
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x5e(%rax), %edi
callq 0x26580
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
movzwl %ax, %r8d
movq -0x40(%rbp), %r9
xorl %edi, %edi
leaq 0xc2e43(%rip), %rsi     # 0x141cbd
movb $0x0, %al
callq 0x2fc60
movq -0x40(%rbp), %rdi
callq 0x38620
movq -0x20(%rbp), %rdi
callq 0x7c820
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x7f031
cmpq $0x0, -0x28(%rbp)
je 0x7ef56
movq -0x28(%rbp), %rax
movl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7ef56
movq -0x38(%rbp), %rax
cmpq 0x10dc95(%rip), %rax    # 0x18cb60
je 0x7ef56
movzwl -0x2a(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x7ef1d
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7e010
cmpl $0x0, %eax
je 0x7ef12
movq -0x28(%rbp), %rdx
addq $0x8, %rdx
movq -0x38(%rbp), %rcx
addq $0x8, %rcx
movl $0x1, %edi
leaq 0xc2dc8(%rip), %rsi     # 0x141cd3
movb $0x0, %al
callq 0x2fc60
movq -0x38(%rbp), %rdi
callq 0x7e8b0
jmp 0x7ef54
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7e160
cmpl $0x0, %eax
je 0x7ef52
movq -0x28(%rbp), %rdx
addq $0x8, %rdx
movq -0x38(%rbp), %rcx
addq $0x8, %rcx
movl $0x1, %edi
leaq 0xc2db9(%rip), %rsi     # 0x141d04
movb $0x0, %al
callq 0x2fc60
jmp 0x7ef54
jmp 0x7ef56
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0x7f02f
movzwl -0x2a(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x7f02f
movzwl -0x2a(%rbp), %eax
andl $0xc, %eax
cmpl $0x0, %eax
jne 0x7f02f
movq -0x38(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
movq -0x20(%rbp), %rsi
addq $0x30, %rsi
callq 0x26300
cmpl $0x0, %eax
jne 0x7efcd
movq -0x38(%rbp), %rax
movl 0x8c0(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x5e(%rax), %edi
callq 0x26580
movw %ax, %cx
movl -0x5c(%rbp), %eax
movzwl %cx, %ecx
cmpl %ecx, %eax
je 0x7f02f
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8c8(%rax)
je 0x7efeb
movq -0x38(%rbp), %rax
movq 0x8c8(%rax), %rdi
callq 0x7dbf0
movq -0x38(%rbp), %rdi
addq $0x890, %rdi            # imm = 0x890
movq -0x20(%rbp), %rsi
addq $0x30, %rsi
movl $0x2e, %edx
callq 0x26c60
movq -0x20(%rbp), %rax
movzwl 0x5e(%rax), %edi
callq 0x26580
movzwl %ax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8c0(%rax)
movq -0x38(%rbp), %rax
movl 0x30(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x30(%rax)
jmp 0x7f079
cmpq $0x0, -0x28(%rbp)
je 0x7f077
movzwl -0x2a(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x7f077
movq -0x20(%rbp), %rdi
callq 0x7e850
cmpl $0x0, %eax
jne 0x7f077
movq -0x20(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x5e(%rax), %edi
callq 0x26580
movq -0x68(%rbp), %rdi
movzwl %ax, %esi
callq 0x7ec10
jmp 0x7f079
movq -0x20(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x20(%rbp)
jmp 0x7edf1
addq $0x70, %rsp
popq %rbp
retq