LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelGetInstanceTypeString
char *sentinelGetInstanceTypeString(sentinelRedisInstance *ri) {
    if (ri->flags & SRI_MASTER) return "master";
    else if (ri->flags & SRI_SLAVE) return "slave";
    else if (ri->flags & SRI_SENTINEL) return "sentinel";
    else return "unknown";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x96cf3
leaq 0xac037(%rip), %rax     # 0x142d24
movq %rax, -0x8(%rbp)
jmp 0x96d34
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x96d0e
leaq 0xac06e(%rip), %rax     # 0x142d76
movq %rax, -0x8(%rbp)
jmp 0x96d34
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x96d29
leaq 0xafbaf(%rip), %rax     # 0x1468d2
movq %rax, -0x8(%rbp)
jmp 0x96d34
leaq 0xa4aed(%rip), %rax     # 0x13b81d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x97baf
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x97bc5
movq -0x8(%rbp), %rax
movq 0xb8(%rax), %rax
movq 0x98(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x97c0d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
movq -0x18(%rbp), %r8
leaq -0x2107(%rip), %rsi     # 0x95ae0
leaq 0xaea9b(%rip), %rcx     # 0x146689
movb $0x0, %al
callq 0xa6e80
cmpl $0x0, %eax
jne 0x97c0b
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x97c0d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x18(%rbp), %r8
movl $0x40, %esi
leaq 0xaea49(%rip), %rdx     # 0x146691
leaq 0xf53b9(%rip), %rcx     # 0x18d008
movb $0x0, %al
callq 0x26120
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq -0x60(%rbp), %r8
leaq -0x2189(%rip), %rsi     # 0x95ae0
leaq 0xaea32(%rip), %rcx     # 0x1466a2
movb $0x0, %al
callq 0xa6e80
cmpl $0x0, %eax
jne 0x97c8d
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0xb8(%rax)
je 0x98092
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9814e
movl $0x20, %edi
callq 0x3acd0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movl 0x84(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
leaq 0x4877(%rip), %rcx      # 0x9c960
movq %rcx, 0xc0(%rax)
movq -0x18(%rbp), %rax
leaq 0x48c5(%rip), %rcx      # 0x9c9c0
movq %rcx, 0xc8(%rax)
movq -0x18(%rbp), %rax
leaq 0x4903(%rip), %rcx      # 0x9ca10
movq %rcx, 0xd0(%rax)
movq -0x18(%rbp), %rax
leaq 0x4951(%rip), %rcx      # 0x9ca70
movq %rcx, 0xd8(%rax)
movq -0x18(%rbp), %rax
leaq 0x498f(%rip), %rcx      # 0x9cac0
movq %rcx, 0xe0(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xb8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x107d(%rip), %rsi      # 0x99200
leaq 0xa47b3(%rip), %rcx     # 0x13c93d
movb $0x0, %al
callq 0xa6e80
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x981ef
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x40(%rax)
jne 0x981e6
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x48(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x40(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x981f6
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9822a
cmpq $0x0, -0x20(%rbp)
jne 0x9822f
jmp 0x982fb
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x2ff70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x982b1
movq -0x28(%rbp), %rax
cmpq $0x3, 0x20(%rax)
jne 0x982b1
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x982b1
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x1, (%rax)
jne 0x982b1
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x1, (%rax)
jne 0x982b1
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
leaq 0xae89c(%rip), %rsi     # 0x146b43
callq 0x268f0
cmpl $0x0, %eax
je 0x982b3
jmp 0x982fb
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdi
leaq 0xf4d3e(%rip), %rsi     # 0x18d008
callq 0x266c0
cmpq $0x0, %rax
je 0x982d7
jmp 0x982fb
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
movl 0x10(%rax), %esi
callq 0x99400
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x9(%rbp)
je 0x9836a
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x1, 0x68(%rcx)
movb %al, -0x9(%rbp)
jne 0x9836a
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0x18, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x9(%rbp)
jne 0x9836a
callq 0x2ff70
movq -0x8(%rbp), %rcx
subq 0x60(%rcx), %rax
cmpq $0x4e20, %rax           # imm = 0x4E20
setl %al
movb %al, -0x9(%rbp)
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x98f63
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x98fab
movq -0x10(%rbp), %rax
cmpq $0x7d1, 0x30(%rax)      # imm = 0x7D1
jl 0x98f84
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
subq $0x7d1, %rcx            # imm = 0x7D1
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x999b0
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x999b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x991c9
cmpq $0x0, -0x28(%rbp)
jne 0x991cb
jmp 0x991fa
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x991fa
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x98380
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x993c9
cmpq $0x0, -0x28(%rbp)
jne 0x993cb
jmp 0x993f9
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x6, (%rax)
je 0x993f9
callq 0x2ff70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2e470
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x99a0b
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x7d1, 0x30(%rax)      # imm = 0x7D1
jl 0x99a09
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
subq $0x7d1, %rcx            # imm = 0x7D1
movq %rcx, 0x30(%rax)
jmp 0x999c9
movq -0x10(%rbp), %rdi
callq 0x2e600
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverStateStr
const char *sentinelFailoverStateStr(int state) {
    switch(state) {
    case SENTINEL_FAILOVER_STATE_NONE: return "none";
    case SENTINEL_FAILOVER_STATE_WAIT_START: return "wait_start";
    case SENTINEL_FAILOVER_STATE_SELECT_SLAVE: return "select_slave";
    case SENTINEL_FAILOVER_STATE_SEND_SLAVEOF_NOONE: return "send_slaveof_noone";
    case SENTINEL_FAILOVER_STATE_WAIT_PROMOTION: return "wait_promotion";
    case SENTINEL_FAILOVER_STATE_RECONF_SLAVES: return "reconf_slaves";
    case SENTINEL_FAILOVER_STATE_UPDATE_CONFIG: return "update_config";
    default: return "unknown";
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0x6, %rax
ja 0x99c33
movq -0x18(%rbp), %rax
leaq 0xac35d(%rip), %rcx     # 0x145f2c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa1dbb(%rip), %rax     # 0x13b99a
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xacd5b(%rip), %rax     # 0x146947
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xacd59(%rip), %rax     # 0x146952
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xacd59(%rip), %rax     # 0x14695f
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xacd5f(%rip), %rax     # 0x146972
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xacd61(%rip), %rax     # 0x146981
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xacd62(%rip), %rax     # 0x14698f
movq %rax, -0x8(%rbp)
jmp 0x99c3e
leaq 0xa1be3(%rip), %rax     # 0x13b81d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e400
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
addq 0x48(%rax), %rsi
callq 0x437f0
movq -0x18(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x9a6e4
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x99c50
jmp 0x9a6b6
movq -0x18(%rbp), %rdi
callq 0x2e600
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelGetMasterByNameOrReplyError
sentinelRedisInstance *sentinelGetMasterByNameOrReplyError(client *c,
                        robj *name)
{
    sentinelRedisInstance *ri;

    ri = dictFetchValue(sentinel.masters,name->ptr);
    if (!ri) {
        addReplyError(c,"No such master with that name");
        return NULL;
    }
    return ri;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq 0xf2929(%rip), %rdi     # 0x18d040
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x2e280
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x9a749
movq -0x10(%rbp), %rdi
leaq 0xac431(%rip), %rsi     # 0x146b6b
callq 0x42f90
movq $0x0, -0x8(%rbp)
jmp 0x9a751
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq 0x48(%rcx), %rax
addq $0x1, %rax
movl %eax, -0x2c(%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 0x9a7f1
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
andl $0x18, %eax
cmpl $0x0, %eax
je 0x9a7e6
jmp 0x9a7b7
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x9a7b7
movq -0x18(%rbp), %rdi
callq 0x2e600
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x90(%rcx), %eax
jge 0x9a812
movl -0x28(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x3c(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x9a838
movl -0x28(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9a848
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq 0xf27b5(%rip), %rax     # 0x18d038
jbe 0x9a8ba
movq -0x10(%rbp), %rax
movq %rax, 0xf27a8(%rip)     # 0x18d038
callq 0x946c0
movq -0x8(%rbp), %rdx
movq 0xf2798(%rip), %r8      # 0x18d038
movl $0x3, %edi
leaq 0xac02f(%rip), %rsi     # 0x1468db
leaq 0xa78b7(%rip), %rcx     # 0x14216a
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
cmpq -0x10(%rbp), %rax
jae 0x9a99b
movq 0xf2762(%rip), %rax     # 0x18d038
cmpq -0x10(%rbp), %rax
ja 0x9a99b
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x38620
movq -0x18(%rbp), %rdi
callq 0x38510
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq 0xf272a(%rip), %rcx     # 0x18d038
movq -0x8(%rbp), %rax
movq %rcx, 0xe0(%rax)
callq 0x946c0
movq -0x8(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %r8
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %r9
movl $0x3, %edi
leaq 0xac896(%rip), %rsi     # 0x1471da
leaq 0xabc3e(%rip), %rcx     # 0x146589
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
leaq 0xf26a4(%rip), %rsi     # 0x18d008
callq 0x26300
cmpl $0x0, %eax
je 0x9a999
callq 0x2ff70
movq %rax, -0x28(%rbp)
callq 0x26b80
movq -0x28(%rbp), %rcx
movl $0x3e8, %esi            # imm = 0x3E8
cltd
idivl %esi
movslq %edx, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x100(%rax)
jmp 0x9a99b
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
je 0x9a9d1
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x38510
movq %rax, -0x30(%rbp)
jmp 0x9a9d9
xorl %eax, %eax
movq %rax, -0x30(%rbp)
jmp 0x9a9d9
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x9abcc
jmp 0x9abee
leaq 0xac677(%rip), %rdi     # 0x14724a
leaq 0xab382(%rip), %rsi     # 0x145f5c
movl $0xed5, %edx            # imm = 0xED5
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rax
movl $0x1, 0xf0(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
orl $0x40, %ecx
movl %ecx, (%rax)
movq 0xf242a(%rip), %rcx     # 0x18d038
addq $0x1, %rcx
movq %rcx, 0xf241f(%rip)     # 0x18d038
movq -0x8(%rbp), %rax
movq %rcx, 0xe8(%rax)
movq -0x8(%rbp), %rdx
movq 0xf2409(%rip), %r8      # 0x18d038
movl $0x3, %edi
leaq 0xabca0(%rip), %rsi     # 0x1468db
leaq 0xa7528(%rip), %rcx     # 0x14216a
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xac60c(%rip), %rsi     # 0x147265
leaq 0xab5ac(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
callq 0x2ff70
movq %rax, -0x10(%rbp)
callq 0x26b80
movq -0x10(%rbp), %rcx
movl $0x3e8, %esi            # imm = 0x3E8
cltd
idivl %esi
movslq %edx, %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x100(%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x9b3fc
movl $0x1, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x2e400
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x9b3db
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x9b3d9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9b3a3
movq -0x10(%rbp), %rdi
callq 0x2e600
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x90(%rcx), %eax
jb 0x9b3fa
movl $0x1, -0x20(%rbp)
jmp 0x9b3fc
cmpl $0x0, -0x20(%rbp)
je 0x9b45a
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x9b458
movq -0x8(%rbp), %rdx
movl -0x1c(%rbp), %r8d
movq -0x8(%rbp), %rax
movl 0x90(%rax), %r9d
movl $0x3, %edi
leaq 0xabd15(%rip), %rsi     # 0x147144
leaq 0xabd15(%rip), %rcx     # 0x14714b
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rax
movl (%rax), %ecx
orl $0x10, %ecx
movl %ecx, (%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
jmp 0x9b493
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x9b491
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xabce4(%rip), %rsi     # 0x14715c
leaq 0xaad8d(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $-0x11, %ecx
movl %ecx, (%rax)
jmp 0x9b493
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2dcb0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x9b831
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x4(%rbp)
jmp 0x9b882
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2d950
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x9b84b
jmp 0x9b86d
leaq 0xa01df(%rip), %rdi     # 0x13ba31
leaq 0xaa703(%rip), %rsi     # 0x145f5c
movl $0xe44, %edx            # imm = 0xE44
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
jmp 0x9b86f
movq -0x20(%rbp), %rax
movq $0x1, 0x8(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x9bb16
movl $0x0, -0x4(%rbp)
jmp 0x9bbf0
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x9bb30
movl $0x0, -0x4(%rbp)
jmp 0x9bbf0
callq 0x2ff70
movq -0x10(%rbp), %rcx
subq 0x100(%rcx), %rax
movq -0x10(%rbp), %rcx
movq 0x108(%rcx), %rcx
shlq %rcx
cmpq %rcx, %rax
jge 0x9bbe0
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x100(%rcx), %rax
je 0x9bbd7
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x108(%rcx), %rcx
shlq %rcx
addq %rcx, %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
leaq -0x40(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x26bd0
movb $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x110(%rax)
leaq -0x40(%rbp), %rdx
movl $0x3, %edi
leaq 0xab6a3(%rip), %rsi     # 0x147273
movb $0x0, %al
callq 0x2fc60
movl $0x0, -0x4(%rbp)
jmp 0x9bbf0
movq -0x10(%rbp), %rdi
callq 0x9abb0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl 0xa8(%rax), %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0xa8(%rcx), %eax
je 0x9bc5e
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl 0xa8(%rax), %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
subl 0xa8(%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x9bd1a
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0xd0(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0xd0(%rcx), %rax
jbe 0x9bc88
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9bd1a
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0xd0(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0xd0(%rcx), %rax
jae 0x9bcaf
movl $0x1, -0x4(%rbp)
jmp 0x9bd1a
jmp 0x9bcb1
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x9bce6
cmpq $0x0, -0x38(%rbp)
jne 0x9bce6
movl $0x0, -0x4(%rbp)
jmp 0x9bd1a
cmpq $0x0, -0x30(%rbp)
jne 0x9bcf6
movl $0x1, -0x4(%rbp)
jmp 0x9bd1a
cmpq $0x0, -0x38(%rbp)
jne 0x9bd06
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9bd1a
jmp 0x9bd08
jmp 0x9bd0a
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x26300
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x9beac
jmp 0x9bece
leaq 0xab53e(%rip), %rdi     # 0x1473f1
leaq 0xaa0a2(%rip), %rsi     # 0x145f5c
movl $0x1074, %edx           # imm = 0x1074
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rax
cmpl $0x4, 0xf0(%rax)
jg 0x9bedd
jmp 0x9beff
leaq 0xab532(%rip), %rdi     # 0x147416
leaq 0xaa071(%rip), %rsi     # 0x145f5c
movl $0x1075, %edx           # imm = 0x1075
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0xfffff7bf, %ecx       # imm = 0xFFFFF7BF
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xf0(%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x118(%rax)
je 0x9bf60
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rax
movl (%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x118(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9a9f0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x9bfb9
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xab357(%rip), %rsi     # 0x1472f7
leaq 0xaa265(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdi
callq 0x9be90
jmp 0x9c033
movq -0x10(%rbp), %rdx
movl $0x3, %edi
leaq 0xab34c(%rip), %rsi     # 0x147315
leaq 0xaa23c(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq -0x10(%rbp), %rax
movl (%rax), %ecx
orl $0x80, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x3, 0xf0(%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf8(%rax)
movq -0x10(%rbp), %rdx
movl $0x2, %edi
leaq 0xab300(%rip), %rsi     # 0x147325
leaq 0xaa1e0(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rax
movq 0x28(%rax), %rax
cmpl $0x0, 0x4(%rax)
je 0x9c0a7
callq 0x2ff70
movq -0x8(%rbp), %rcx
subq 0xf8(%rcx), %rax
movq -0x8(%rbp), %rcx
cmpq 0x108(%rcx), %rax
jle 0x9c0a5
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xab2ba(%rip), %rsi     # 0x147348
leaq 0xaa177(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdi
callq 0x9be90
jmp 0x9c10e
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x98fc0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x9c0c8
jmp 0x9c10e
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rdx
movl $0x2, %edi
leaq 0xab287(%rip), %rsi     # 0x147366
leaq 0xaa126(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rax
movl $0x4, 0xf0(%rax)
callq 0x2ff70
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2ff70
movq -0x8(%rbp), %rcx
subq 0xf8(%rcx), %rax
movq -0x8(%rbp), %rcx
cmpq 0x108(%rcx), %rax
jle 0x9c170
movq -0x8(%rbp), %rdx
movl $0x3, %edi
leaq 0xab1ef(%rip), %rsi     # 0x147348
leaq 0xaa0ac(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdi
callq 0x9be90
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x118(%rax)
je 0x9c5cb
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x9c5d3
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %r9
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x8(%rax), %r11d
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %r10
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x8(%rax), %eax
movl $0x3, %edi
leaq 0xaa2da(%rip), %rsi     # 0x1468fa
leaq 0xaa2e2(%rip), %rcx     # 0x146909
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x8(%rax), %edx
callq 0x96900
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFailoverStateMachine
void sentinelFailoverStateMachine(sentinelRedisInstance *ri) {
    serverAssert(ri->flags & SRI_MASTER);

    if (!(ri->flags & SRI_FAILOVER_IN_PROGRESS)) return;

    switch(ri->failover_state) {
        case SENTINEL_FAILOVER_STATE_WAIT_START:
            sentinelFailoverWaitStart(ri);
            break;
        case SENTINEL_FAILOVER_STATE_SELECT_SLAVE:
            sentinelFailoverSelectSlave(ri);
            break;
        case SENTINEL_FAILOVER_STATE_SEND_SLAVEOF_NOONE:
            sentinelFailoverSendSlaveOfNoOne(ri);
            break;
        case SENTINEL_FAILOVER_STATE_WAIT_PROMOTION:
            sentinelFailoverWaitPromotion(ri);
            break;
        case SENTINEL_FAILOVER_STATE_RECONF_SLAVES:
            sentinelFailoverReconfNextSlave(ri);
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x9c67c
jmp 0x9c69e
leaq 0xa9b58(%rip), %rdi     # 0x1461db
leaq 0xa98d2(%rip), %rsi     # 0x145f5c
movl $0x1057, %edx           # imm = 0x1057
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x9c6ae
jmp 0x9c70e
movq -0x8(%rbp), %rax
movl 0xf0(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x4, %eax
ja 0x9c70e
movq -0x10(%rbp), %rax
leaq 0xa9878(%rip), %rcx     # 0x145f48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
callq 0x9bd30
jmp 0x9c70e
movq -0x8(%rbp), %rdi
callq 0x9bf70
jmp 0x9c70e
movq -0x8(%rbp), %rdi
callq 0x9c040
jmp 0x9c70e
movq -0x8(%rbp), %rdi
callq 0x9c120
jmp 0x9c70e
movq -0x8(%rbp), %rdi
callq 0x9c3a0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelHandleRedisInstance
void sentinelHandleRedisInstance(sentinelRedisInstance *ri) {
    /* ========== MONITORING HALF ============ */
    /* Every kind of instance */
    sentinelReconnectInstance(ri);
    sentinelSendPeriodicCommands(ri);

    /* ============== ACTING HALF ============= */
    /* We don't proceed with the acting half if we are in TILT mode.
     * TILT happens when we find something odd with the time, like a
     * sudden change in the clock. */
    if (sentinel.tilt) {
        if (mstime()-sentinel.tilt_start_time < SENTINEL_TILT_PERIOD) return;
        sentinel.tilt = 0;
        sentinelEvent(LL_WARNING,"-tilt",NULL,"#tilt mode exited");
    }

    /* Every kind of instance */
    sentinelCheckSubjectivelyDown(ri);

    /* Masters and slaves */
    if (ri->flags & (SRI_MASTER|SRI_SLAVE)) {
        /* Nothing so far. */
    }

    /* Only masters */
    if (ri->flags & SRI_MASTER) {
        sentinelCheckObjectivelyDown(ri);
        if (sentinelStartFailoverIfNeeded(ri))
            sentinelAskMasterStateToOtherSentinels(ri,SENTINEL_ASK_FORCED);
        sentinelFailoverStateMachine(ri);
        sentinelAskMasterStateToOtherSentinels(ri,SENTINEL_NO_FLAGS);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x97ca0
movq -0x8(%rbp), %rdi
callq 0x99a20
cmpl $0x0, 0xf0903(%rip)     # 0x18d048
je 0x9c788
callq 0x2ff70
subq 0xf08fd(%rip), %rax     # 0x18d050
cmpq $0x7530, %rax           # imm = 0x7530
jge 0x9c760
jmp 0x9c7e8
movl $0x0, 0xf08de(%rip)     # 0x18d048
movl $0x3, %edi
leaq 0xaacdd(%rip), %rsi     # 0x147453
xorl %eax, %eax
movl %eax, %edx
leaq 0xaacd8(%rip), %rcx     # 0x147459
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdi
callq 0x9b110
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x9c7a1
jmp 0x9c7a1
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x9c7e8
movq -0x8(%rbp), %rdi
callq 0x9b360
movq -0x8(%rbp), %rdi
callq 0x9baf0
cmpl $0x0, %eax
je 0x9c7d4
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9b660
movq -0x8(%rbp), %rdi
callq 0x9c660
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9b660
addq $0x10, %rsp
popq %rbp
retq
nop