// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelUpdateSentinelAddressInAllMasters
int sentinelUpdateSentinelAddressInAllMasters(sentinelRedisInstance *ri) {
    serverAssert(ri->flags & SRI_SENTINEL);
    dictIterator *di;
    dictEntry *de;
    int reconfigured = 0;

    di = dictGetIterator(sentinel.masters);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *master = dictGetVal(de), *match;
        match = getSentinelRedisInstanceByAddrAndRunID(master->sentinels,
                                                       NULL,0,ri->runid);
        /* If there is no match, this master does not know about this
         * Sentinel, try with the next one. */
        if (match == NULL) continue;

        /* Disconnect the old links if connected. */
        if (match->link->cc != NULL)
            instanceLinkCloseConnection(match->link,match->link->cc);
        if (match->link->pc != NULL)
            instanceLinkCloseConnection(match->link,match->link->pc);

        if (match == ri) continue; /* Address already updated for it. */

        /* Update the address of the matching Sentinel by copying the address
         * of the Sentinel object that received the address update. */
        releaseSentinelAddr(match->addr);
        match->addr = dupSentinelAddr(ri->addr);
        reconfigured++;
    }
    dictReleaseIterator(di);
    if (reconfigured)
        sentinelEvent(LL_NOTICE,"+sentinel-address-update", ri,
                    "%@ %d additional matching instances", reconfigured);
    return reconfigured;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x95d7c
jmp 0x95d9e
leaq 0xb03af(%rip), %rdi     # 0x146132
leaq 0xb01d2(%rip), %rsi     # 0x145f5c
movl $0x41f, %edx            # imm = 0x41F
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movl $0x0, -0x1c(%rbp)
movq 0xf7294(%rip), %rdi     # 0x18d040
callq 0x2e400
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x95e95
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x95c60
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x95e03
jmp 0x95db5
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x95e2b
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x95940
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x95e53
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x95940
movq -0x30(%rbp), %rax
cmpq -0x8(%rbp), %rax
jne 0x95e62
jmp 0x95db5
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x94900
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x948b0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x95db5
movq -0x10(%rbp), %rdi
callq 0x2e600
cmpl $0x0, -0x1c(%rbp)
je 0x95ec6
movq -0x8(%rbp), %rdx
movl -0x1c(%rbp), %r8d
movl $0x2, %edi
leaq 0xb0293(%rip), %rsi     # 0x14614b
leaq 0xb02a5(%rip), %rcx     # 0x146164
movb $0x0, %al
callq 0x94990
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop