LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: removeMatchingSentinelFromMaster
int removeMatchingSentinelFromMaster(sentinelRedisInstance *master, char *runid) {
    dictIterator *di;
    dictEntry *de;
    int removed = 0;

    if (runid == NULL) return 0;

    di = dictGetSafeIterator(master->sentinels);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);

        if (ri->runid && strcmp(ri->runid,runid) == 0) {
            dictDelete(master->sentinels,ri->name);
            removed++;
        }
    }
    dictReleaseIterator(di);
    return removed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0x77cf4
movq %rsi, %rbx
movq %rdi, %r14
movq 0x80(%rdi), %rdi
callq 0x2efe5
movq %rax, %r15
movq %rax, %rdi
callq 0x2f015
xorl %ebp, %ebp
testq %rax, %rax
je 0x77cea
movq 0x8(%rax), %r12
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x77ce0
movq %rbx, %rsi
callq 0x268f0
testl %eax, %eax
jne 0x77ce0
movq 0x80(%r14), %rdi
movq 0x8(%r12), %rsi
callq 0x2ecb5
incl %ebp
movq %r15, %rdi
callq 0x2f015
jmp 0x77cae
movq %r15, %rdi
callq 0x2f0dd
jmp 0x77cf6
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelGetMasterByName
sentinelRedisInstance *sentinelGetMasterByName(char *name) {
    sentinelRedisInstance *ri;
    sds sdsname = sdsnew(name);

    ri = dictFetchValue(sentinel.masters,sdsname);
    sdsfree(sdsname);
    return ri;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x362b0
movq %rax, %rbx
movq 0x9e9fc(%rip), %rdi     # 0x116710
movq %rax, %rsi
callq 0x2ef19
movq %rax, %r14
movq %rbx, %rdi
callq 0x36330
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelAddFlagsToDictOfRedisInstances
void sentinelAddFlagsToDictOfRedisInstances(dict *instances, int flags) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetIterator(instances);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);
        ri->flags |= flags;
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
callq 0x2efbb
movq %rax, %r14
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x77d58
movq 0x8(%rax), %rax
orl %ebx, (%rax)
movq %r14, %rdi
jmp 0x77d43
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelResetMaster
void sentinelResetMaster(sentinelRedisInstance *ri, int flags) {
    serverAssert(ri->flags & SRI_MASTER);
    dictRelease(ri->slaves);
    ri->slaves = dictCreate(&instancesDictType,NULL);
    if (!(flags & SENTINEL_RESET_NO_SENTINELS)) {
        dictRelease(ri->sentinels);
        ri->sentinels = dictCreate(&instancesDictType,NULL);
    }
    instanceLinkCloseConnection(ri->link,ri->link->cc);
    instanceLinkCloseConnection(ri->link,ri->link->pc);
    ri->flags &= SRI_MASTER;
    if (ri->leader) {
        sdsfree(ri->leader);
        ri->leader = NULL;
    }
    ri->failover_state = SENTINEL_FAILOVER_STATE_NONE;
    ri->failover_state_change_time = 0;
    ri->failover_start_time = 0; /* We can failover again ASAP. */
    ri->promoted_slave = NULL;
    sdsfree(ri->runid);
    sdsfree(ri->slave_master_host);
    ri->runid = NULL;
    ri->slave_master_host = NULL;
    ri->link->act_ping_time = mstime();
    ri->link->last_ping_time = 0;
    ri->link->last_avail_time = mstime();
    ri->link->last_pong_time = mstime();
    ri->role_reported_time = mstime();
    ri->role_reported = SRI_MASTER;
    if (flags & SENTINEL_GENERATE_EVENT)
        sentinelEvent(LL_WARNING,"+reset-master",ri,"%@");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testb $0x1, (%rdi)
je 0x77ede
movl %esi, %ebp
movq %rdi, %rbx
movq 0x88(%rdi), %rdi
callq 0x2eef3
leaq 0x894e5(%rip), %rdi     # 0x1012b0
xorl %esi, %esi
callq 0x2e68c
movq %rax, 0x88(%rbx)
testb $0x1, %bpl
jne 0x77e00
movq 0x80(%rbx), %rdi
callq 0x2eef3
leaq 0x894be(%rip), %rdi     # 0x1012b0
xorl %esi, %esi
callq 0x2e68c
movq %rax, 0x80(%rbx)
movq 0x28(%rbx), %rdi
movq 0x10(%rdi), %rsi
callq 0x77559
movq 0x28(%rbx), %rdi
movq 0x18(%rdi), %rsi
callq 0x77559
andl $0x1, (%rbx)
movq 0xd8(%rbx), %rdi
testq %rdi, %rdi
je 0x77e39
callq 0x36330
movq $0x0, 0xd8(%rbx)
movl $0x0, 0xf0(%rbx)
xorl %r14d, %r14d
movq %r14, 0x118(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xf8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x36330
movq 0xc0(%rbx), %rdi
callq 0x36330
movq %r14, 0x10(%rbx)
movq %r14, 0xc0(%rbx)
callq 0x2ffce
movq 0x28(%rbx), %rcx
movq %rax, 0x40(%rcx)
movq %r14, 0x48(%rcx)
callq 0x2ffce
movq 0x28(%rbx), %rcx
movq %rax, 0x38(%rcx)
callq 0x2ffce
movq 0x28(%rbx), %rcx
movq %rax, 0x50(%rcx)
callq 0x2ffce
movq %rax, 0x70(%rbx)
movl $0x1, 0x68(%rbx)
btl $0x10, %ebp
jb 0x77ebd
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x5462e(%rip), %rsi     # 0xcc4f2
leaq 0x54635(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x76a24
leaq 0x545ea(%rip), %rdi     # 0xcc4cf
leaq 0x54364(%rip), %rsi     # 0xcc250
movl $0x577, %edx            # imm = 0x577
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelResetMastersByPattern
int sentinelResetMastersByPattern(char *pattern, int flags) {
    dictIterator *di;
    dictEntry *de;
    int reset = 0;

    di = dictGetIterator(sentinel.masters);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);

        if (ri->name) {
            if (stringmatch(pattern,ri->name,0)) {
                sentinelResetMaster(ri,flags);
                reset++;
            }
        }
    }
    dictReleaseIterator(di);
    return reset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x9e7fc(%rip), %rdi     # 0x116710
callq 0x2efbb
movq %rax, %rbx
movq %rax, %rdi
callq 0x2f015
xorl %r15d, %r15d
testq %rax, %rax
je 0x77f5f
movq 0x8(%rax), %r12
movq 0x8(%r12), %rsi
testq %rsi, %rsi
je 0x77f55
movq %r14, %rdi
xorl %edx, %edx
callq 0x3fcb6
testl %eax, %eax
je 0x77f55
movq %r12, %rdi
movl %ebp, %esi
callq 0x77da6
incl %r15d
movq %rbx, %rdi
callq 0x2f015
jmp 0x77f27
movq %rbx, %rdi
callq 0x2f0dd
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelRedisInstanceNoDownFor
int sentinelRedisInstanceNoDownFor(sentinelRedisInstance *ri, mstime_t ms) {
    mstime_t most_recent;

    most_recent = ri->s_down_since_time;
    if (ri->o_down_since_time > most_recent)
        most_recent = ri->o_down_since_time;
    return most_recent == 0 || (mstime() - most_recent) > ms;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x48(%rdi), %r14
movq 0x50(%rdi), %rax
cmpq %r14, %rax
cmovgq %rax, %r14
testq %r14, %r14
je 0x78173
movq %rsi, %rbx
callq 0x2ffce
movq %rax, %rcx
subq %r14, %rcx
xorl %eax, %eax
cmpq %rbx, %rcx
setg %al
jmp 0x78178
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelPropagateDownAfterPeriod
void sentinelPropagateDownAfterPeriod(sentinelRedisInstance *master) {
    dictIterator *di;
    dictEntry *de;
    int j;
    dict *d[] = {master->slaves, master->sentinels, NULL};

    for (j = 0; d[j]; j++) {
        di = dictGetIterator(d[j]);
        while((de = dictNext(di)) != NULL) {
            sentinelRedisInstance *ri = dictGetVal(de);
            ri->down_after_period = master->down_after_period;
        }
        dictReleaseIterator(di);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x88(%rdi), %rdi
movq %rdi, (%rsp)
movq 0x80(%rbx), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
testq %rdi, %rdi
je 0x78211
xorl %r15d, %r15d
callq 0x2efbb
movq %rax, %r14
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x781fc
movq 0x8(%rax), %rax
movq 0x58(%rbx), %rcx
movq %rcx, 0x58(%rax)
movq %r14, %rdi
jmp 0x781e1
movq %r14, %rdi
callq 0x2f0dd
movq 0x8(%rsp,%r15,8), %rdi
incq %r15
testq %rdi, %rdi
jne 0x781d6
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelSendAuthIfNeeded
void sentinelSendAuthIfNeeded(sentinelRedisInstance *ri, redisAsyncContext *c) {
    char *auth_pass = (ri->flags & SRI_MASTER) ? ri->auth_pass :
                                                 ri->master->auth_pass;

    if (auth_pass) {
        if (redisAsyncCommand(c, sentinelDiscardReplyCallback, ri, "AUTH %s",
            auth_pass) == C_OK) ri->link->pending_commands++;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x1, (%rdi)
movq %rdi, %rax
jne 0x78c93
movq 0xb8(%rbx), %rax
movq 0x98(%rax), %r8
testq %r8, %r8
je 0x78cc8
leaq -0x166e(%rip), %rax     # 0x77638
leaq 0x53cd0(%rip), %rcx     # 0xcc97d
movq %rsi, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x82c47
testl %eax, %eax
jne 0x78cc8
movq 0x28(%rbx), %rax
incl 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelSetClientName
void sentinelSetClientName(sentinelRedisInstance *ri, redisAsyncContext *c, char *type) {
    char name[64];

    snprintf(name,sizeof(name),"sentinel-%.8s-%s",sentinel.myid,type);
    if (redisAsyncCommand(c, sentinelDiscardReplyCallback, ri,
        "CLIENT SETNAME %s", name) == C_OK)
    {
        ri->link->pending_commands++;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x53ca2(%rip), %rdx     # 0xcc985
leaq 0x9d9ee(%rip), %rcx     # 0x1166d8
movq %rsp, %r15
movl $0x40, %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x26120
leaq -0x16cb(%rip), %rsi     # 0x77638
leaq 0x53c8c(%rip), %rcx     # 0xcc996
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x82c47
testl %eax, %eax
jne 0x78d25
movq 0x28(%rbx), %rax
incl 0x8(%rax)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: redisAeAttach
static int redisAeAttach(aeEventLoop *loop, redisAsyncContext *ac) {
    redisContext *c = &(ac->c);
    redisAeEvents *e;

    /* Nothing should be attached when something is already attached */
    if (ac->ev.data != NULL)
        return C_ERR;

    /* Create container for context and r/w events */
    e = (redisAeEvents*)zmalloc(sizeof(*e));
    e->context = ac;
    e->loop = loop;
    e->fd = c->fd;
    e->reading = e->writing = 0;

    /* Register functions to start/stop listening for events */
    ac->ev.addRead = redisAeAddRead;
    ac->ev.delRead = redisAeDelRead;
    ac->ev.addWrite = redisAeAddWrite;
    ac->ev.delWrite = redisAeDelWrite;
    ac->ev.cleanup = redisAeCleanup;
    ac->ev.data = e;

    return C_OK;
}

// Assembly:
cmpq $0x0, 0xb8(%rsi)
je 0x78f87
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x20, %edi
callq 0x382d1
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movl 0x84(%rbx), %ecx
movl %ecx, 0x10(%rax)
movq $0x0, 0x14(%rax)
leaq 0x33e7(%rip), %rcx      # 0x7c3a1
movq %rcx, 0xc0(%rbx)
leaq 0x3404(%rip), %rcx      # 0x7c3cc
movq %rcx, 0xc8(%rbx)
leaq 0x3418(%rip), %rcx      # 0x7c3ee
movq %rcx, 0xd0(%rbx)
leaq 0x3435(%rip), %rcx      # 0x7c419
movq %rcx, 0xd8(%rbx)
leaq 0x3449(%rip), %rcx      # 0x7c43b
movq %rcx, 0xe0(%rbx)
movq %rax, 0xb8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelSendPing
int sentinelSendPing(sentinelRedisInstance *ri) {
    int retval = redisAsyncCommand(ri->link->cc,
        sentinelPingReplyCallback, ri, "PING");
    if (retval == C_OK) {
        ri->link->pending_commands++;
        ri->link->last_ping_time = mstime();
        /* We update the active ping time only if we received the pong for
         * the previous ping, otherwise we are technically waiting since the
         * first ping that did not received a reply. */
        if (ri->link->act_ping_time == 0)
            ri->link->act_ping_time = ri->link->last_ping_time;
        return 1;
    } else {
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x10(%rax), %rdi
leaq 0xd42(%rip), %rsi       # 0x79d5f
leaq 0x4904d(%rip), %rcx     # 0xc2071
xorl %ebp, %ebp
movq %rbx, %rdx
xorl %eax, %eax
callq 0x82c47
testl %eax, %eax
jne 0x79058
movq 0x28(%rbx), %rax
incl 0x8(%rax)
callq 0x2ffce
movq 0x28(%rbx), %rcx
movq %rax, 0x48(%rcx)
movl $0x1, %ebp
cmpq $0x0, 0x40(%rcx)
jne 0x79058
movq %rax, 0x40(%rcx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelReceiveHelloMessages
void sentinelReceiveHelloMessages(redisAsyncContext *c, void *reply, void *privdata) {
    sentinelRedisInstance *ri = privdata;
    redisReply *r;
    UNUSED(c);

    if (!reply || !ri) return;
    r = reply;

    /* Update the last activity in the pubsub channel. Note that since we
     * receive our messages as well this timestamp can be used to detect
     * if the link is probably disconnected even if it seems otherwise. */
    ri->link->pc_last_activity = mstime();

    /* Sanity check in the reply we expect, so that the code that follows
     * can avoid to check for details. */
    if (r->type != REDIS_REPLY_ARRAY ||
        r->elements != 3 ||
        r->element[0]->type != REDIS_REPLY_STRING ||
        r->element[1]->type != REDIS_REPLY_STRING ||
        r->element[2]->type != REDIS_REPLY_STRING ||
        strcmp(r->element[0]->str,"message") != 0) return;

    /* We are not interested in meeting ourselves */
    if (strstr(r->element[2]->str,sentinel.myid) != NULL) return;

    sentinelProcessHelloMessage(r->element[2]->str, r->element[2]->len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x790df
movq %rdx, %r14
movq %rsi, %rbx
callq 0x2ffce
movq 0x28(%r14), %rcx
movq %rax, 0x30(%rcx)
cmpl $0x2, (%rbx)
jne 0x790df
cmpq $0x3, 0x20(%rbx)
jne 0x790df
movq 0x28(%rbx), %rcx
movq (%rcx), %rax
cmpl $0x1, (%rax)
jne 0x790df
movq 0x8(%rcx), %rdx
cmpl $0x1, (%rdx)
jne 0x790df
movq 0x10(%rcx), %r14
cmpl $0x1, (%r14)
jne 0x790df
movq 0x18(%rax), %rdi
leaq 0x53d79(%rip), %rsi     # 0xcce37
callq 0x268f0
testl %eax, %eax
jne 0x790df
movq 0x18(%r14), %rbx
leaq 0x9d606(%rip), %rsi     # 0x1166d8
movq %rbx, %rdi
callq 0x266b0
testq %rax, %rax
je 0x790e7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl 0x10(%r14), %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x79e8d
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelMasterLooksSane
int sentinelMasterLooksSane(sentinelRedisInstance *master) {
    return
        master->flags & SRI_MASTER &&
        master->role_reported == SRI_MASTER &&
        (master->flags & (SRI_S_DOWN|SRI_O_DOWN)) == 0 &&
        (mstime() - master->info_refresh) < SENTINEL_INFO_PERIOD*2;
}

// Assembly:
movl (%rdi), %ecx
xorl %eax, %eax
testb $0x1, %cl
je 0x7912b
testb $0x18, %cl
jne 0x7912b
pushq %rbx
movq %rdi, %rbx
cmpl $0x1, 0x68(%rdi)
jne 0x7912a
callq 0x2ffce
movq %rax, %rcx
subq 0x60(%rbx), %rcx
xorl %eax, %eax
cmpq $0x4e20, %rcx           # imm = 0x4E20
setl %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelForceHelloUpdateForMaster
int sentinelForceHelloUpdateForMaster(sentinelRedisInstance *master) {
    if (!(master->flags & SRI_MASTER)) return C_ERR;
    if (master->last_pub_time >= (SENTINEL_PUBLISH_PERIOD+1))
        master->last_pub_time -= (SENTINEL_PUBLISH_PERIOD+1);
    sentinelForceHelloUpdateDictOfRedisInstances(master->sentinels);
    sentinelForceHelloUpdateDictOfRedisInstances(master->slaves);
    return C_OK;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, (%rdi)
je 0x79c0f
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rax
cmpq $0x7d1, %rax            # imm = 0x7D1
jl 0x79bf4
addq $-0x7d1, %rax           # imm = 0xF82F
movq %rax, 0x30(%rbx)
movq 0x80(%rbx), %rdi
callq 0x7a2e8
movq 0x88(%rbx), %rdi
callq 0x7a2e8
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelInfoReplyCallback
void sentinelInfoReplyCallback(redisAsyncContext *c, void *reply, void *privdata) {
    sentinelRedisInstance *ri = privdata;
    instanceLink *link = c->data;
    redisReply *r;

    if (!reply || !link) return;
    link->pending_commands--;
    r = reply;

    if (r->type == REDIS_REPLY_STRING)
        sentinelRefreshInstanceInfo(ri,r->str);
}

// Assembly:
movq 0xb0(%rdi), %rax
testq %rsi, %rsi
setne %cl
testq %rax, %rax
setne %dil
andb %cl, %dil
cmpb $0x1, %dil
jne 0x79d5e
decl 0x8(%rax)
cmpl $0x1, (%rsi)
jne 0x79d5e
movq 0x18(%rsi), %rsi
movq %rdx, %rdi
jmp 0x7912c
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelPingReplyCallback
void sentinelPingReplyCallback(redisAsyncContext *c, void *reply, void *privdata) {
    sentinelRedisInstance *ri = privdata;
    instanceLink *link = c->data;
    redisReply *r;

    if (!reply || !link) return;
    link->pending_commands--;
    r = reply;

    if (r->type == REDIS_REPLY_STATUS ||
        r->type == REDIS_REPLY_ERROR) {
        /* Update the "instance available" field only if this is an
         * acceptable reply. */
        if (strncmp(r->str,"PONG",4) == 0 ||
            strncmp(r->str,"LOADING",7) == 0 ||
            strncmp(r->str,"MASTERDOWN",10) == 0)
        {
            link->last_avail_time = mstime();
            link->act_ping_time = 0; /* Flag the pong as received. */
        } else {
            /* Send a SCRIPT KILL command if the instance appears to be
             * down because of a busy script. */
            if (strncmp(r->str,"BUSY",4) == 0 &&
                (ri->flags & SRI_S_DOWN) &&
                !(ri->flags & SRI_SCRIPT_KILL_SENT))
            {
                if (redisAsyncCommand(ri->link->cc,
                        sentinelDiscardReplyCallback, ri,
                        "SCRIPT KILL") == C_OK)
                    ri->link->pending_commands++;
                ri->flags |= SRI_SCRIPT_KILL_SENT;
            }
        }
    }
    link->last_pong_time = mstime();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0xb0(%rdi), %r15
testq %rsi, %rsi
setne %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x79e56
decl 0x8(%r15)
movl (%rsi), %eax
addl $-0x5, %eax
cmpl $0x1, %eax
ja 0x79e4d
movq %rdx, %rbx
movq 0x18(%rsi), %r14
leaq 0x52db2(%rip), %rsi     # 0xccb54
movl $0x4, %edx
movq %r14, %rdi
callq 0x26350
testl %eax, %eax
je 0x79e3c
leaq 0x52d9b(%rip), %rsi     # 0xccb59
movl $0x7, %edx
movq %r14, %rdi
callq 0x26350
testl %eax, %eax
je 0x79e3c
leaq 0x52d8b(%rip), %rsi     # 0xccb61
movl $0xa, %edx
movq %r14, %rdi
callq 0x26350
testl %eax, %eax
je 0x79e3c
leaq 0x52d7e(%rip), %rsi     # 0xccb6c
movl $0x4, %edx
movq %r14, %rdi
callq 0x26350
testl %eax, %eax
jne 0x79e4d
movl $0x1008, %eax           # imm = 0x1008
andl (%rbx), %eax
cmpl $0x8, %eax
jne 0x79e4d
movq 0x28(%rbx), %rax
movq 0x10(%rax), %rdi
leaq -0x27e2(%rip), %rsi     # 0x77638
leaq 0x52d50(%rip), %rcx     # 0xccb71
movq %rbx, %rdx
xorl %eax, %eax
callq 0x82c47
testl %eax, %eax
jne 0x79e36
movq 0x28(%rbx), %rax
incl 0x8(%rax)
orb $0x10, 0x1(%rbx)
jmp 0x79e4d
callq 0x2ffce
movq %rax, 0x38(%r15)
movq $0x0, 0x40(%r15)
callq 0x2ffce
movq %rax, 0x50(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelPublishReplyCallback
void sentinelPublishReplyCallback(redisAsyncContext *c, void *reply, void *privdata) {
    sentinelRedisInstance *ri = privdata;
    instanceLink *link = c->data;
    redisReply *r;

    if (!reply || !link) return;
    link->pending_commands--;
    r = reply;

    /* Only update pub_time if we actually published our message. Otherwise
     * we'll retry again in 100 milliseconds. */
    if (r->type != REDIS_REPLY_ERROR)
        ri->last_pub_time = mstime();
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movq 0xb0(%rdi), %rax
testq %rsi, %rsi
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x79e8b
decl 0x8(%rax)
cmpl $0x6, (%rsi)
je 0x79e8b
callq 0x2ffce
movq %rax, 0x30(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelForceHelloUpdateDictOfRedisInstances
void sentinelForceHelloUpdateDictOfRedisInstances(dict *instances) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(instances);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);
        if (ri->last_pub_time >= (SENTINEL_PUBLISH_PERIOD+1))
            ri->last_pub_time -= (SENTINEL_PUBLISH_PERIOD+1);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbx
callq 0x2efe5
movq %rax, %rbx
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x7a31f
movq 0x8(%rax), %rax
movq 0x30(%rax), %rcx
cmpq $0x7d1, %rcx            # imm = 0x7D1
jl 0x7a31a
addq $-0x7d1, %rcx           # imm = 0xF82F
movq %rcx, 0x30(%rax)
movq %rbx, %rdi
jmp 0x7a2f4
movq %rbx, %rdi
popq %rbx
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: addReplyDictOfRedisInstances
void addReplyDictOfRedisInstances(client *c, dict *instances) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetIterator(instances);
    addReplyMultiBulkLen(c,dictSize(instances));
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);

        addReplySentinelRedisInstance(c,ri);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2efbb
movq %rax, %r14
movq 0x48(%r15), %rsi
addq 0x28(%r15), %rsi
movq %rbx, %rdi
callq 0x3d274
movq %r14, %rdi
callq 0x2f015
testq %rax, %rax
je 0x7ab69
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x7a435
jmp 0x7ab4e
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelIsQuorumReachable
int sentinelIsQuorumReachable(sentinelRedisInstance *master, int *usableptr) {
    dictIterator *di;
    dictEntry *de;
    int usable = 1; /* Number of usable Sentinels. Init to 1 to count myself. */
    int result = SENTINEL_ISQR_OK;
    int voters = dictSize(master->sentinels)+1; /* Known Sentinels + myself. */

    di = dictGetIterator(master->sentinels);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);

        if (ri->flags & (SRI_S_DOWN|SRI_O_DOWN)) continue;
        usable++;
    }
    dictReleaseIterator(di);

    if (usable < (int)master->quorum) result |= SENTINEL_ISQR_NOQUORUM;
    if (usable < voters/2+1) result |= SENTINEL_ISQR_NOAUTH;
    if (usableptr) *usableptr = usable;
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x80(%rdi), %rdi
movq 0x28(%rdi), %r12
movq 0x48(%rdi), %r13
callq 0x2efbb
movq %rax, %r15
movq %rax, %rdi
callq 0x2f015
movl $0x1, %ebp
testq %rax, %rax
je 0x7ac02
movq 0x8(%rax), %rax
movl (%rax), %eax
andl $0x18, %eax
cmpl $0x1, %eax
adcl $0x0, %ebp
movq %r15, %rdi
callq 0x2f015
jmp 0x7abe4
movq %r15, %rdi
callq 0x2f0dd
movl 0x90(%r14), %eax
testq %rbx, %rbx
je 0x7ac18
movl %ebp, (%rbx)
leal (%r12,%r13), %ecx
leal (%r12,%r13), %edx
incl %edx
shrl $0x1f, %edx
addl %edx, %ecx
incl %ecx
sarl %ecx
xorl %edx, %edx
cmpl %eax, %ebp
setl %dl
leal 0x2(%rdx), %eax
cmpl %ecx, %ebp
cmovgl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelVoteLeader
char *sentinelVoteLeader(sentinelRedisInstance *master, uint64_t req_epoch, char *req_runid, uint64_t *leader_epoch) {
    if (req_epoch > sentinel.current_epoch) {
        sentinel.current_epoch = req_epoch;
        sentinelFlushConfig();
        sentinelEvent(LL_WARNING,"+new-epoch",master,"%llu",
            (unsigned long long) sentinel.current_epoch);
    }

    if (master->leader_epoch < req_epoch && sentinel.current_epoch <= req_epoch)
    {
        sdsfree(master->leader);
        master->leader = sdsnew(req_runid);
        master->leader_epoch = sentinel.current_epoch;
        sentinelFlushConfig();
        sentinelEvent(LL_WARNING,"+vote-for-leader",master,"%s %llu",
            master->leader, (unsigned long long) master->leader_epoch);
        /* If we did not voted for ourselves, set the master failover start
         * time to now, in order to force a delay before we can start a
         * failover for the same master. */
        if (strcasecmp(master->leader,sentinel.myid))
            master->failover_start_time = mstime()+rand()%SENTINEL_MAX_DESYNC;
    }

    *leader_epoch = master->leader_epoch;
    return master->leader ? sdsnew(master->leader) : NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0x9baa4(%rip), %rax     # 0x116708
cmpq %rsi, %rax
jae 0x7aca0
movq %r12, 0x9ba98(%rip)     # 0x116708
callq 0x76861
movq 0x9ba8c(%rip), %r8      # 0x116708
leaq 0x51f4c(%rip), %rsi     # 0xccbcf
leaq 0x4d45f(%rip), %rcx     # 0xc80e9
movl $0x3, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x76a24
movq 0x9ba68(%rip), %rax     # 0x116708
cmpq %r12, 0xe0(%r14)
jae 0x7ad60
cmpq %r12, %rax
ja 0x7ad60
movq 0xd8(%r14), %rdi
callq 0x36330
movq %r15, %rdi
callq 0x362b0
movq %rax, 0xd8(%r14)
leaq 0x9ba00(%rip), %r15     # 0x1166d8
movq 0x9ba29(%rip), %rax     # 0x116708
movq %rax, 0xe0(%r14)
callq 0x76861
movq 0xd8(%r14), %r8
movq 0xe0(%r14), %r9
leaq 0x527ce(%rip), %rsi     # 0xcd4ce
leaq 0x51b76(%rip), %rcx     # 0xcc87d
movl $0x3, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x76a24
movq 0xd8(%r14), %rdi
movq %r15, %rsi
callq 0x262f0
testl %eax, %eax
je 0x7ad60
callq 0x2ffce
movq %rax, %r15
callq 0x26b70
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
cltq
addq %r15, %rax
movq %rax, 0x100(%r14)
movq 0xe0(%r14), %rax
movq %rax, (%rbx)
movq 0xd8(%r14), %rdi
testq %rdi, %rdi
je 0x7ad86
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x362b0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelStartFailover
void sentinelStartFailover(sentinelRedisInstance *master) {
    serverAssert(master->flags & SRI_MASTER);

    master->failover_state = SENTINEL_FAILOVER_STATE_WAIT_START;
    master->flags |= SRI_FAILOVER_IN_PROGRESS;
    master->failover_epoch = ++sentinel.current_epoch;
    sentinelEvent(LL_WARNING,"+new-epoch",master,"%llu",
        (unsigned long long) sentinel.current_epoch);
    sentinelEvent(LL_WARNING,"+try-failover",master,"%@");
    master->failover_start_time = mstime()+rand()%SENTINEL_MAX_DESYNC;
    master->failover_state_change_time = mstime();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl (%rdi), %eax
testb $0x1, %al
je 0x7af8f
movq %rdi, %rbx
movl $0x1, 0xf0(%rdi)
orl $0x40, %eax
movl %eax, (%rdi)
movq 0x9b80f(%rip), %r8      # 0x116708
incq %r8
movq %r8, 0x9b805(%rip)      # 0x116708
movq %r8, 0xe8(%rdi)
leaq 0x51cbe(%rip), %rsi     # 0xccbcf
leaq 0x4d1d1(%rip), %rcx     # 0xc80e9
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
leaq 0x5262b(%rip), %rsi     # 0xcd559
leaq 0x515cb(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
callq 0x2ffce
movq %rax, %r14
callq 0x26b70
cltq
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
cltq
addq %r14, %rax
movq %rax, 0x100(%rbx)
callq 0x2ffce
movq %rax, 0xf8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x525a8(%rip), %rdi     # 0xcd53e
leaq 0x512b3(%rip), %rsi     # 0xcc250
movl $0xed5, %edx            # imm = 0xED5
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelCheckObjectivelyDown
void sentinelCheckObjectivelyDown(sentinelRedisInstance *master) {
    dictIterator *di;
    dictEntry *de;
    unsigned int quorum = 0, odown = 0;

    if (master->flags & SRI_S_DOWN) {
        /* Is down for enough sentinels? */
        quorum = 1; /* the current sentinel. */
        /* Count all the other sentinels. */
        di = dictGetIterator(master->sentinels);
        while((de = dictNext(di)) != NULL) {
            sentinelRedisInstance *ri = dictGetVal(de);

            if (ri->flags & SRI_MASTER_DOWN) quorum++;
        }
        dictReleaseIterator(di);
        if (quorum >= master->quorum) odown = 1;
    }

    /* Set the flag accordingly to the outcome. */
    if (odown) {
        if ((master->flags & SRI_O_DOWN) == 0) {
            sentinelEvent(LL_WARNING,"+odown",master,"%@ #quorum %d/%d",
                quorum, master->quorum);
            master->flags |= SRI_O_DOWN;
            master->o_down_since_time = mstime();
        }
    } else {
        if (master->flags & SRI_O_DOWN) {
            sentinelEvent(LL_WARNING,"-odown",master,"%@");
            master->flags &= ~SRI_O_DOWN;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
testb $0x8, %al
je 0x7b4bc
movq 0x80(%rbx), %rdi
callq 0x2efbb
movq %rax, %r14
movq %rax, %rdi
callq 0x2f015
movl $0x1, %ebp
testq %rax, %rax
je 0x7b4a6
movq 0x8(%rax), %rax
btl $0x5, (%rax)
adcl $0x0, %ebp
movq %r14, %rdi
callq 0x2f015
jmp 0x7b48c
movq %r14, %rdi
callq 0x2f0dd
movl (%rbx), %eax
movl 0x90(%rbx), %r9d
cmpl %r9d, %ebp
jae 0x7b4e2
testb $0x10, %al
je 0x7b512
leaq 0x51f89(%rip), %rsi     # 0xcd450
leaq 0x51032(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
andb $-0x11, (%rbx)
jmp 0x7b512
testb $0x10, %al
jne 0x7b512
leaq 0x51f4b(%rip), %rsi     # 0xcd438
leaq 0x51f4b(%rip), %rcx     # 0xcd43f
movl $0x3, %edi
movq %rbx, %rdx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x76a24
orb $0x10, (%rbx)
callq 0x2ffce
movq %rax, 0x50(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelReceiveIsMasterDownReply
void sentinelReceiveIsMasterDownReply(redisAsyncContext *c, void *reply, void *privdata) {
    sentinelRedisInstance *ri = privdata;
    instanceLink *link = c->data;
    redisReply *r;

    if (!reply || !link) return;
    link->pending_commands--;
    r = reply;

    /* Ignore every error or unexpected reply.
     * Note that if the command returns an error for any reason we'll
     * end clearing the SRI_MASTER_DOWN flag for timeout anyway. */
    if (r->type == REDIS_REPLY_ARRAY && r->elements == 3 &&
        r->element[0]->type == REDIS_REPLY_INTEGER &&
        r->element[1]->type == REDIS_REPLY_STRING &&
        r->element[2]->type == REDIS_REPLY_INTEGER)
    {
        ri->last_master_down_reply_time = mstime();
        if (r->element[0]->integer == 1) {
            ri->flags |= SRI_MASTER_DOWN;
        } else {
            ri->flags &= ~SRI_MASTER_DOWN;
        }
        if (strcmp(r->element[1]->str,"*")) {
            /* If the runid in the reply is not "*" the Sentinel actually
             * replied with a vote. */
            sdsfree(ri->leader);
            if ((long long)ri->leader_epoch != r->element[2]->integer)
                serverLog(LL_WARNING,
                    "%s voted for %s %llu", ri->name,
                    r->element[1]->str,
                    (unsigned long long) r->element[2]->integer);
            ri->leader = sdsnew(r->element[1]->str);
            ri->leader_epoch = r->element[2]->integer;
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0xb0(%rdi), %rax
testq %rsi, %rsi
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x7b624
movq %rsi, %r14
decl 0x8(%rax)
cmpl $0x2, (%rsi)
jne 0x7b624
cmpq $0x3, 0x20(%r14)
jne 0x7b624
movq 0x28(%r14), %rax
movq (%rax), %rcx
cmpl $0x3, (%rcx)
jne 0x7b624
movq 0x8(%rax), %rcx
cmpl $0x1, (%rcx)
jne 0x7b624
movq 0x10(%rax), %rax
cmpl $0x3, (%rax)
jne 0x7b624
callq 0x2ffce
movq %rax, 0x40(%rbx)
movq 0x28(%r14), %rax
movq (%rax), %rcx
xorl %edx, %edx
cmpq $0x1, 0x8(%rcx)
sete %dl
movl (%rbx), %ecx
andl $-0x21, %ecx
shll $0x5, %edx
orl %ecx, %edx
movl %edx, (%rbx)
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
cmpb $0x2a, (%rax)
jne 0x7b5b9
cmpb $0x0, 0x1(%rax)
je 0x7b624
movq 0xd8(%rbx), %rdi
callq 0x36330
movq 0x28(%r14), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rcx), %r8
cmpq %r8, 0xe0(%rbx)
je 0x7b5fd
movq 0x8(%rbx), %rdx
movq 0x8(%rax), %rax
movq 0x18(%rax), %rcx
leaq 0x51e6a(%rip), %rsi     # 0xcd457
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
movq 0x28(%r14), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x362b0
movq %rax, 0xd8(%rbx)
movq 0x28(%r14), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0xe0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelLeaderIncr
int sentinelLeaderIncr(dict *counters, char *runid) {
    dictEntry *de = dictFind(counters,runid);
    uint64_t oldval;

    if (de) {
        oldval = dictGetUnsignedIntegerVal(de);
        dictSetUnsignedIntegerVal(de,oldval+1);
        return oldval+1;
    } else {
        de = dictAddRaw(counters,runid);
        serverAssert(de != NULL);
        dictSetUnsignedIntegerVal(de,1);
        return 1;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2ebca
testq %rax, %rax
je 0x7b780
movq %rax, %rcx
movq 0x8(%rax), %rax
incq %rax
movq %rax, 0x8(%rcx)
jmp 0x7b79d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e9fb
testq %rax, %rax
je 0x7b7a5
movq $0x1, 0x8(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x45929(%rip), %rdi     # 0xc10d5
leaq 0x50a9d(%rip), %rsi     # 0xcc250
movl $0xe44, %edx            # imm = 0xE44
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelStartFailoverIfNeeded
int sentinelStartFailoverIfNeeded(sentinelRedisInstance *master) {
    /* We can't failover if the master is not in O_DOWN state. */
    if (!(master->flags & SRI_O_DOWN)) return 0;

    /* Failover already in progress? */
    if (master->flags & SRI_FAILOVER_IN_PROGRESS) return 0;

    /* Last failover attempt started too little time ago? */
    if (mstime() - master->failover_start_time <
        master->failover_timeout*2)
    {
        if (master->failover_delay_logged != master->failover_start_time) {
            time_t clock = (master->failover_start_time +
                            master->failover_timeout*2) / 1000;
            char ctimebuf[26];

            ctime_r(&clock,ctimebuf);
            ctimebuf[24] = '\0'; /* Remove newline. */
            master->failover_delay_logged = master->failover_start_time;
            serverLog(LL_WARNING,
                "Next failover delay: I will not start a failover before %s",
                ctimebuf);
        }
        return 0;
    }

    sentinelStartFailover(master);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl (%rdi), %eax
andl $0x50, %eax
xorl %ebp, %ebp
cmpl $0x10, %eax
jne 0x7ba4a
movq %rdi, %rbx
callq 0x2ffce
movq %rax, %rcx
movq 0x100(%rbx), %rdx
movq 0x108(%rbx), %rax
subq %rdx, %rcx
addq %rax, %rax
cmpq %rax, %rcx
jge 0x7ba3d
cmpq %rdx, 0x110(%rbx)
je 0x7ba4a
addq %rdx, %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, (%rdi)
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x26bc0
movb $0x0, 0x18(%r14)
movq 0x100(%rbx), %rax
movq %rax, 0x110(%rbx)
leaq 0x51b3d(%rip), %rsi     # 0xcd567
xorl %ebp, %ebp
movl $0x3, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2fdad
jmp 0x7ba4a
movq %rbx, %rdi
callq 0x7aed2
movl $0x1, %ebp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: compareSlavesForPromotion
int compareSlavesForPromotion(const void *a, const void *b) {
    sentinelRedisInstance **sa = (sentinelRedisInstance **)a,
                          **sb = (sentinelRedisInstance **)b;
    char *sa_runid, *sb_runid;

    if ((*sa)->slave_priority != (*sb)->slave_priority)
        return (*sa)->slave_priority - (*sb)->slave_priority;

    /* If priority is the same, select the slave with greater replication
     * offset (processed more data from the master). */
    if ((*sa)->slave_repl_offset > (*sb)->slave_repl_offset) {
        return -1; /* a < b */
    } else if ((*sa)->slave_repl_offset < (*sb)->slave_repl_offset) {
        return 1; /* a > b */
    }

    /* If the replication offset is the same select the slave with that has
     * the lexicographically smaller runid. Note that we try to handle runid
     * == NULL as there are old Redis versions that don't publish runid in
     * INFO. A NULL runid is considered bigger than any other runid. */
    sa_runid = (*sa)->runid;
    sb_runid = (*sb)->runid;
    if (sa_runid == NULL && sb_runid == NULL) return 0;
    else if (sa_runid == NULL) return 1;  /* a > b */
    else if (sb_runid == NULL) return -1; /* a < b */
    return strcasecmp(sa_runid, sb_runid);
}

// Assembly:
movq (%rdi), %rcx
movl 0xa8(%rcx), %eax
movq (%rsi), %rdx
subl 0xa8(%rdx), %eax
jne 0x7babf
movq 0xd0(%rdx), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rsi, 0xd0(%rcx)
ja 0x7babf
movl $0x1, %eax
jb 0x7babf
movq 0x10(%rcx), %rdi
movq 0x10(%rdx), %rsi
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %r8b
xorl %ecx, %ecx
movq %rdi, %rdx
orq %rsi, %rdx
setne %dl
orb %al, %r8b
xorl %eax, %eax
movq %rdi, %r9
negq %r9
sbbl %eax, %eax
testb %r8b, %r8b
je 0x262f0
movb %dl, %cl
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverWaitStart
void sentinelFailoverWaitStart(sentinelRedisInstance *ri) {
    char *leader;
    int isleader;

    /* Check if we are the leader for the failover epoch. */
    leader = sentinelGetLeader(ri, ri->failover_epoch);
    isleader = leader && strcasecmp(leader,sentinel.myid) == 0;
    sdsfree(leader);

    /* If I'm not the leader, and it is not a forced failover via
     * SENTINEL FAILOVER, then I can't continue with the failover. */
    if (!isleader && !(ri->flags & SRI_FORCE_FAILOVER)) {
        int election_timeout = SENTINEL_ELECTION_TIMEOUT;

        /* The election timeout is the MIN between SENTINEL_ELECTION_TIMEOUT
         * and the configured failover timeout. */
        if (election_timeout > ri->failover_timeout)
            election_timeout = ri->failover_timeout;
        /* Abort the failover if I'm not the leader after some time. */
        if (mstime() - ri->failover_start_time > election_timeout) {
            sentinelEvent(LL_WARNING,"-failover-abort-not-elected",ri,"%@");
            sentinelAbortFailover(ri);
        }
        return;
    }
    sentinelEvent(LL_WARNING,"+elected-leader",ri,"%@");
    if (sentinel.simfailure_flags & SENTINEL_SIMFAILURE_CRASH_AFTER_ELECTION)
        sentinelSimFailureCrash();
    ri->failover_state = SENTINEL_FAILOVER_STATE_SELECT_SLAVE;
    ri->failover_state_change_time = mstime();
    sentinelEvent(LL_WARNING,"+failover-state-select-slave",ri,"%@");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xe8(%rdi), %rsi
callq 0x7b7c7
testq %rax, %rax
je 0x7bafa
movq %rax, %r14
leaq 0x9abf6(%rip), %rsi     # 0x1166d8
movq %rax, %rdi
callq 0x262f0
movl %eax, %ebp
movq %r14, %rdi
callq 0x36330
testl %ebp, %ebp
jne 0x7bb01
jmp 0x7bb5b
xorl %edi, %edi
callq 0x36330
testb $0x8, 0x1(%rbx)
jne 0x7bb5b
movq 0x108(%rbx), %rax
movl $0x2710, %ecx           # imm = 0x2710
cmpq %rcx, %rax
movslq %eax, %r14
cmovgeq %rcx, %r14
callq 0x2ffce
subq 0x100(%rbx), %rax
cmpq %r14, %rax
jle 0x7bbb8
leaq 0x51a69(%rip), %rsi     # 0xcd5a2
leaq 0x509c0(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x7bbda
leaq 0x51a5c(%rip), %rsi     # 0xcd5be
leaq 0x50997(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
testb $0x1, 0x9abc9(%rip)     # 0x116748
jne 0x7bbbd
movl $0x2, 0xf0(%rbx)
callq 0x2ffce
movq %rax, 0xf8(%rbx)
leaq 0x51a30(%rip), %rsi     # 0xcd5ce
leaq 0x5095b(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x76a24
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x518d6(%rip), %rsi     # 0xcd49a
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
movl $0x63, %edi
callq 0x262c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelAbortFailover
void sentinelAbortFailover(sentinelRedisInstance *ri) {
    serverAssert(ri->flags & SRI_FAILOVER_IN_PROGRESS);
    serverAssert(ri->failover_state <= SENTINEL_FAILOVER_STATE_WAIT_PROMOTION);

    ri->flags &= ~(SRI_FAILOVER_IN_PROGRESS|SRI_FORCE_FAILOVER);
    ri->failover_state = SENTINEL_FAILOVER_STATE_NONE;
    ri->failover_state_change_time = mstime();
    if (ri->promoted_slave) {
        ri->promoted_slave->flags &= ~SRI_PROMOTED;
        ri->promoted_slave = NULL;
    }
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
testb $0x40, %al
je 0x7bc26
movq %rdi, %rbx
cmpl $0x5, 0xf0(%rdi)
jge 0x7bc3b
andl $0xfffff7bf, %eax       # imm = 0xFFFFF7BF
movl %eax, (%rbx)
movl $0x0, 0xf0(%rbx)
callq 0x2ffce
movq %rax, 0xf8(%rbx)
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0x7bc24
andb $0x7f, (%rax)
movq $0x0, 0x118(%rbx)
popq %rbx
retq
leaq 0x51ab8(%rip), %rdi     # 0xcd6e5
leaq 0x5061c(%rip), %rsi     # 0xcc250
movl $0x1074, %edx           # imm = 0x1074
jmp 0x7bc4e
leaq 0x51ac8(%rip), %rdi     # 0xcd70a
leaq 0x50607(%rip), %rsi     # 0xcc250
movl $0x1075, %edx           # imm = 0x1075
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverSelectSlave
void sentinelFailoverSelectSlave(sentinelRedisInstance *ri) {
    sentinelRedisInstance *slave = sentinelSelectSlave(ri);

    /* We don't handle the timeout in this state as the function aborts
     * the failover or go forward in the next state. */
    if (slave == NULL) {
        sentinelEvent(LL_WARNING,"-failover-abort-no-good-slave",ri,"%@");
        sentinelAbortFailover(ri);
    } else {
        sentinelEvent(LL_WARNING,"+selected-slave",slave,"%@");
        slave->flags |= SRI_PROMOTED;
        ri->promoted_slave = slave;
        ri->failover_state = SENTINEL_FAILOVER_STATE_SEND_SLAVEOF_NOONE;
        ri->failover_state_change_time = mstime();
        sentinelEvent(LL_NOTICE,"+failover-state-send-slaveof-noone",
            slave, "%@");
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x7ad94
testq %rax, %rax
je 0x7bcd1
movq %rax, %r14
leaq 0x51990(%rip), %rsi     # 0xcd609
leaq 0x50880(%rip), %r15     # 0xcc500
movl $0x3, %edi
movq %rax, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x76a24
orb $-0x80, (%r14)
movq %r14, 0x118(%rbx)
movl $0x3, 0xf0(%rbx)
callq 0x2ffce
movq %rax, 0xf8(%rbx)
leaq 0x5195f(%rip), %rsi     # 0xcd619
movl $0x2, %edi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x76a24
leaq 0x51913(%rip), %rsi     # 0xcd5eb
leaq 0x50821(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x7bbda
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverSendSlaveOfNoOne
void sentinelFailoverSendSlaveOfNoOne(sentinelRedisInstance *ri) {
    int retval;

    /* We can't send the command to the promoted slave if it is now
     * disconnected. Retry again and again with this state until the timeout
     * is reached, then abort the failover. */
    if (ri->promoted_slave->link->disconnected) {
        if (mstime() - ri->failover_state_change_time > ri->failover_timeout) {
            sentinelEvent(LL_WARNING,"-failover-abort-slave-timeout",ri,"%@");
            sentinelAbortFailover(ri);
        }
        return;
    }

    /* Send SLAVEOF NO ONE command to turn the slave into a master.
     * We actually register a generic callback for this command as we don't
     * really care about the reply. We check if it worked indirectly observing
     * if INFO returns a different role (master instead of slave). */
    retval = sentinelSendSlaveOf(ri->promoted_slave,NULL,0);
    if (retval != C_OK) return;
    sentinelEvent(LL_NOTICE, "+failover-state-wait-promotion",
        ri->promoted_slave,"%@");
    ri->failover_state = SENTINEL_FAILOVER_STATE_WAIT_PROMOTION;
    ri->failover_state_change_time = mstime();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x118(%rdi), %rdi
movq 0x28(%rdi), %rax
cmpl $0x0, 0x4(%rax)
je 0x7bd4b
callq 0x2ffce
subq 0xf8(%rbx), %rax
cmpq 0x108(%rbx), %rax
jle 0x7bd8f
leaq 0x51910(%rip), %rsi     # 0xcd63c
leaq 0x507cd(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
movq %rbx, %rdi
popq %rbx
jmp 0x7bbda
xorl %esi, %esi
xorl %edx, %edx
callq 0x79c10
testl %eax, %eax
jne 0x7bd8f
movq 0x118(%rbx), %rdx
leaq 0x518f4(%rip), %rsi     # 0xcd65a
leaq 0x50793(%rip), %rcx     # 0xcc500
movl $0x2, %edi
xorl %eax, %eax
callq 0x76a24
movl $0x4, 0xf0(%rbx)
callq 0x2ffce
movq %rax, 0xf8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverWaitPromotion
void sentinelFailoverWaitPromotion(sentinelRedisInstance *ri) {
    /* Just handle the timeout. Switching to the next state is handled
     * by the function parsing the INFO command of the promoted slave. */
    if (mstime() - ri->failover_state_change_time > ri->failover_timeout) {
        sentinelEvent(LL_WARNING,"-failover-abort-slave-timeout",ri,"%@");
        sentinelAbortFailover(ri);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2ffce
subq 0xf8(%rbx), %rax
cmpq 0x108(%rbx), %rax
jle 0x7bdd0
leaq 0x5188b(%rip), %rsi     # 0xcd63c
leaq 0x50748(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x76a24
movq %rbx, %rdi
popq %rbx
jmp 0x7bbda
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverSwitchToPromotedSlave
void sentinelFailoverSwitchToPromotedSlave(sentinelRedisInstance *master) {
    sentinelRedisInstance *ref = master->promoted_slave ?
                                 master->promoted_slave : master;

    sentinelEvent(LL_WARNING,"+switch-master",master,"%s %s %d %s %d",
        master->name, master->addr->ip, master->addr->port,
        ref->addr->ip, ref->addr->port);

    sentinelResetMasterAndChangeAddress(master,ref->addr->ip,ref->addr->port);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x118(%rdi), %r14
testq %r14, %r14
cmoveq %rdi, %r14
movq 0x8(%rdi), %r8
movq 0x20(%rdi), %rax
movq (%rax), %r9
movl 0x8(%rax), %r10d
movq 0x20(%r14), %r11
movl 0x8(%r11), %r15d
subq $0x8, %rsp
leaq 0x50aa3(%rip), %rsi     # 0xccbee
leaq 0x50aab(%rip), %rcx     # 0xccbfd
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
pushq %r15
pushq (%r11)
pushq %r10
callq 0x76a24
addq $0x20, %rsp
movq 0x20(%r14), %rax
movq (%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x77f73