// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelAskMasterStateToOtherSentinels
void sentinelAskMasterStateToOtherSentinels(sentinelRedisInstance *master, int flags) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetIterator(master->sentinels);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);
        mstime_t elapsed = mstime() - ri->last_master_down_reply_time;
        char port[32];
        int retval;

        /* If the master state from other sentinel is too old, we clear it. */
        if (elapsed > SENTINEL_ASK_PERIOD*5) {
            ri->flags &= ~SRI_MASTER_DOWN;
            sdsfree(ri->leader);
            ri->leader = NULL;
        }

        /* Only ask if master is down to other sentinels if:
         *
         * 1) We believe it is down, or there is a failover in progress.
         * 2) Sentinel is connected.
         * 3) We did not received the info within SENTINEL_ASK_PERIOD ms. */
        if ((master->flags & SRI_S_DOWN) == 0) continue;
        if (ri->link->disconnected) continue;
        if (!(flags & SENTINEL_ASK_FORCED) &&
            mstime() - ri->last_master_down_reply_time < SENTINEL_ASK_PERIOD)
            continue;

        /* Ask */
        ll2string(port,sizeof(port),master->addr->port);
        retval = redisAsyncCommand(ri->link->cc,
                    sentinelReceiveIsMasterDownReply, ri,
                    "SENTINEL is-master-down-by-addr %s %s %llu %s",
                    master->addr->ip, port,
                    sentinel.current_epoch,
                    (master->failover_state > SENTINEL_FAILOVER_STATE_NONE) ?
                    sentinel.myid : "*");
        if (retval == C_OK) ri->link->pending_commands++;
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x2e400
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x9b7cf
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x2ff70
movq -0x28(%rbp), %rcx
subq 0x40(%rcx), %rax
movq %rax, -0x30(%rbp)
cmpq $0x1388, -0x30(%rbp)    # imm = 0x1388
jle 0x9b6eb
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl $-0x21, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x38620
movq -0x28(%rbp), %rax
movq $0x0, 0xd8(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x9b6fb
jmp 0x9b683
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x0, 0x4(%rax)
je 0x9b70e
jmp 0x9b683
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x9b733
callq 0x2ff70
movq -0x28(%rbp), %rcx
subq 0x40(%rcx), %rax
cmpq $0x3e8, %rax            # imm = 0x3E8
jge 0x9b733
jmp 0x9b683
leaq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq 0x8(%rax), %rdx
movl $0x20, %esi
callq 0x477e0
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %r8
leaq -0x50(%rbp), %r9
movq 0xf18c5(%rip), %r10     # 0x18d038
movq -0x8(%rbp), %rax
movl 0xf0(%rax), %esi
leaq 0x9c3e7(%rip), %rax     # 0x137b6b
leaq 0xf187d(%rip), %rcx     # 0x18d008
cmpl $0x0, %esi
cmovgq %rcx, %rax
leaq -0x2f9(%rip), %rsi      # 0x9b4a0
leaq 0xab9d8(%rip), %rcx     # 0x147178
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xa6e80
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jne 0x9b7ca
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x9b683
movq -0x18(%rbp), %rdi
callq 0x2e600
addq $0x70, %rsp
popq %rbp
retq
nop