LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/bitops.c
// Function: getbitCommand
void getbitCommand(client *c) {
    robj *o;
    char llbuf[32];
    size_t bitoffset;
    size_t byte, bit;
    size_t bitval = 0;

    if (getBitOffsetFromArgument(c,c->argv[2],&bitoffset,0,0) != C_OK)
        return;

    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
        checkType(c,o,OBJ_STRING)) return;

    byte = bitoffset >> 3;
    bit = 7 - (bitoffset & 0x7);
    if (sdsEncodedObject(o)) {
        if (byte < sdslen(o->ptr))
            bitval = ((uint8_t*)o->ptr)[byte] & (1 << bit);
    } else {
        if (byte < (size_t)ll2string(llbuf,sizeof(llbuf),(long)o->ptr))
            bitval = llbuf[byte] & (1 << bit);
    }

    addReply(c, bitval ? shared.cone : shared.czero);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x67ffd
testl %eax, %eax
je 0x683f3
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0x91f0e(%rip), %r12     # 0xfa310
movq 0x20(%r12), %rdx
movq %rbx, %rdi
callq 0x3aee5
testq %rax, %rax
je 0x683e5
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3a311
testl %eax, %eax
jne 0x683e5
movq 0x8(%rsp), %r14
movq %r14, %r13
shrq $0x3, %r13
movl (%r15), %eax
shrl $0x4, %eax
testb $0x7, %al
jne 0x68454
movq 0x8(%r15), %r15
movq %r15, %rdi
callq 0x680a1
cmpq %rax, %r13
jae 0x68495
addq %r13, %r15
jmp 0x68474
movq 0x8(%r15), %rdx
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
callq 0x39796
cltq
cmpq %rax, %r13
jae 0x68495
leaq (%rsp,%r13), %r15
addq $0x10, %r15
movzbl (%r15), %eax
notb %r14b
andb $0x7, %r14b
pushq $0x1
popq %rdx
movl %r14d, %ecx
shll %cl, %edx
xorl %ecx, %ecx
andl %eax, %edx
setne %cl
movq 0x20(%r12,%rcx,8), %rsi
jmp 0x6849a
movq 0x20(%r12), %rsi
movq %rbx, %rdi
callq 0x36987
jmp 0x683e5
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: releaseSentinelRedisInstance
void releaseSentinelRedisInstance(sentinelRedisInstance *ri) {
    /* Release all its slaves or sentinels if any. */
    dictRelease(ri->sentinels);
    dictRelease(ri->slaves);

    /* Disconnect the instance. */
    releaseInstanceLink(ri->link,ri);

    /* Free other resources. */
    sdsfree(ri->name);
    sdsfree(ri->runid);
    sdsfree(ri->notification_script);
    sdsfree(ri->client_reconfig_script);
    sdsfree(ri->slave_master_host);
    sdsfree(ri->leader);
    sdsfree(ri->auth_pass);
    sdsfree(ri->info);
    releaseSentinelAddr(ri->addr);

    /* Clear state into the master if needed. */
    if ((ri->flags & SRI_SLAVE) && (ri->flags & SRI_PROMOTED) && ri->master)
        ri->master->promoted_slave = NULL;

    zfree(ri);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x80(%rdi), %rdi
callq 0x2a8da
movq 0x88(%rbx), %rdi
callq 0x2a8da
movq 0x28(%rbx), %rdi
movq %rbx, %rsi
callq 0x6b21b
movq 0x8(%rbx), %rdi
callq 0x311c8
movq 0x10(%rbx), %rdi
callq 0x311c8
movq 0x120(%rbx), %rdi
callq 0x311c8
movq 0x128(%rbx), %rdi
callq 0x311c8
movq 0xc0(%rbx), %rdi
callq 0x311c8
movq 0xd8(%rbx), %rdi
callq 0x311c8
movq 0x98(%rbx), %rdi
callq 0x311c8
movq 0x130(%rbx), %rdi
callq 0x311c8
movq 0x20(%rbx), %rdi
callq 0x6a782
movl (%rbx), %eax
notl %eax
testb $-0x7e, %al
jne 0x69547
movq 0xb8(%rbx), %rax
testq %rax, %rax
je 0x69547
andq $0x0, 0x118(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x328f9
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelPublishCommand
void sentinelPublishCommand(client *c) {
    if (strcmp(c->argv[1]->ptr,SENTINEL_HELLO_CHANNEL)) {
        addReplyError(c, "Only HELLO messages are accepted by Sentinel instances.");
        return;
    }
    sentinelProcessHelloMessage(c->argv[2]->ptr,sdslen(c->argv[2]->ptr));
    addReplyLongLong(c,1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %r14
movq 0x8(%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x53614(%rip), %rsi     # 0xbd63d
callq 0x268f0
testl %eax, %eax
je 0x6a048
leaq 0x54005(%rip), %rsi     # 0xbe03e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x36b6f
movq 0x10(%r14), %rax
movq 0x8(%rax), %r14
movq %r14, %rdi
callq 0x6c6ff
movq %r14, %rdi
movl %eax, %esi
callq 0x6d657
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x370a6
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelRoleCommand
void sentinelRoleCommand(client *c) {
    dictIterator *di;
    dictEntry *de;

    addReplyMultiBulkLen(c,2);
    addReplyBulkCBuffer(c,"sentinel",8);
    addReplyMultiBulkLen(c,dictSize(sentinel.masters));

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

        addReplyBulkCString(c,ri->name);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x2
popq %rsi
callq 0x370d9
leaq 0x5342f(%rip), %rsi     # 0xbd812
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x3716c
movq 0xa431b(%rip), %rax     # 0x10e710
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x370d9
movq 0xa4304(%rip), %rdi     # 0x10e710
callq 0x2a99f
movq %rax, %r14
movq %r14, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6a433
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x36f5d
jmp 0x6a414
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2aa94
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: initSentinel
void initSentinel(void) {
    unsigned int j;

    /* Remove usual Redis commands from the command table, then just add
     * the SENTINEL command. */
    dictEmpty(server.commands,NULL);
    for (j = 0; j < sizeof(sentinelcmds)/sizeof(sentinelcmds[0]); j++) {
        int retval;
        struct redisCommand *cmd = sentinelcmds+j;

        retval = dictAdd(server.commands, sdsnew(cmd->name), cmd);
        serverAssert(retval == DICT_OK);
    }

    /* Initialize various data structures. */
    sentinel.current_epoch = 0;
    sentinel.masters = dictCreate(&instancesDictType,NULL);
    sentinel.tilt = 0;
    sentinel.tilt_start_time = 0;
    sentinel.previous_time = mstime();
    sentinel.running_scripts = 0;
    sentinel.scripts_queue = listCreate();
    sentinel.announce_ip = NULL;
    sentinel.announce_port = 0;
    sentinel.simfailure_flags = SENTINEL_SIMFAILURE_NONE;
    memset(sentinel.myid,0,sizeof(sentinel.myid));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8f442(%rip), %r15     # 0xf98a8
movq 0x30(%r15), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x2ae99
leaq 0x8ee96(%rip), %r12     # 0xf9310
leaq 0x50(%rbp), %r13
cmpq $0x3c0, %r13            # imm = 0x3C0
je 0x6a4ce
leaq (%r12,%rbp), %rbx
movq 0x30(%r15), %r14
movq (%rbp,%r12), %rdi
callq 0x3115a
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x2a3ed
movq %r13, %rbp
testl %eax, %eax
je 0x6a47a
leaq 0x48277(%rip), %rdi     # 0xb272c
leaq 0x529e0(%rip), %rsi     # 0xbce9c
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
andq $0x0, 0xa4232(%rip)     # 0x10e708
leaq 0x8edd3(%rip), %rdi     # 0xf92b0
xorl %esi, %esi
callq 0x2a155
movq %rax, 0xa4225(%rip)     # 0x10e710
andl $0x0, 0xa4226(%rip)     # 0x10e718
andq $0x0, 0xa4226(%rip)     # 0x10e720
callq 0x2b8ae
movq %rax, 0xa4222(%rip)     # 0x10e728
andl $0x0, 0xa420f(%rip)     # 0x10e71c
callq 0x26e0c
movq %rax, 0xa4217(%rip)     # 0x10e730
andq $0x0, 0xa4217(%rip)     # 0x10e738
andl $0x0, 0xa4218(%rip)     # 0x10e740
andq $0x0, 0xa4218(%rip)     # 0x10e748
xorps %xmm0, %xmm0
movups %xmm0, 0xa419e(%rip)    # 0x10e6d8
movups %xmm0, 0xa41a7(%rip)    # 0x10e6e8
movups %xmm0, 0xa41a9(%rip)    # 0x10e6f1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelIsRunning
void sentinelIsRunning(void) {
    int j;

    if (server.configfile == NULL) {
        serverLog(LL_WARNING,
            "Sentinel started without a config file. Exiting...");
        exit(1);
    } else if (access(server.configfile,W_OK) == -1) {
        serverLog(LL_WARNING,
            "Sentinel config file %s is not writable: %s. Exiting...",
            server.configfile,strerror(errno));
        exit(1);
    }

    /* If this Sentinel has yet no ID set in the configuration file, we
     * pick a random one and persist the config on disk. From now on this
     * will be this Sentinel ID across restarts. */
    for (j = 0; j < CONFIG_RUN_ID_SIZE; j++)
        if (sentinel.myid[j] != 0) break;

    if (j == CONFIG_RUN_ID_SIZE) {
        /* Pick ID and presist the config. */
        getRandomHexChars(sentinel.myid,CONFIG_RUN_ID_SIZE);
        sentinelFlushConfig();
    }

    /* Log its ID to make debugging of issues simpler. */
    serverLog(LL_WARNING,"Sentinel ID is %s", sentinel.myid);

    /* We want to generate a +monitor event for every configured master
     * at startup. */
    sentinelGenerateInitialMonitorEvents();
}

// Assembly:
pushq %rbx
leaq 0x8f349(%rip), %rbx     # 0xf98a8
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x6a5c2
pushq $0x2
popq %rsi
callq 0x26aa0
cmpl $-0x1, %eax
je 0x6a5d5
xorl %eax, %eax
leaq 0xa415a(%rip), %rcx     # 0x10e6d8
cmpq $0x28, %rax
je 0x6a590
cmpb $0x0, (%rax,%rcx)
leaq 0x1(%rax), %rax
je 0x6a57e
jmp 0x6a5a4
leaq 0xa4141(%rip), %rdi     # 0x10e6d8
pushq $0x28
popq %rsi
callq 0x39a57
callq 0x6a604
leaq 0x52967(%rip), %rsi     # 0xbcf12
leaq 0xa4126(%rip), %rdx     # 0x10e6d8
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
popq %rbx
jmp 0x6a689
leaq 0x528de(%rip), %rsi     # 0xbcea7
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
jmp 0x6a5fc
movq 0x8(%rbx), %rbx
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x528ee(%rip), %rsi     # 0xbceda
pushq $0x3
popq %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2b699
pushq $0x1
popq %rdi
callq 0x262c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelFlushConfig
void sentinelFlushConfig(void) {
    int fd = -1;
    int saved_hz = server.hz;
    int rewrite_status;

    server.hz = CONFIG_DEFAULT_HZ;
    rewrite_status = rewriteConfig(server.configfile);
    server.hz = saved_hz;

    if (rewrite_status == -1) goto werr;
    if ((fd = open(server.configfile,O_RDONLY)) == -1) goto werr;
    if (fsync(fd) == -1) goto werr;
    if (close(fd) == EOF) goto werr;
    return;

werr:
    if (fd != -1) close(fd);
    serverLog(LL_WARNING,"WARNING: Sentinel was not able to save the new configuration on disk!!!: %s", strerror(errno));
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x8f29a(%rip), %rbx     # 0xf98a8
movl 0x20(%rbx), %ebp
movl $0xa, 0x20(%rbx)
movq 0x8(%rbx), %rdi
callq 0x52ea3
movl %ebp, 0x20(%rbx)
cmpl $-0x1, %eax
je 0x6a663
movq 0x8(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x26690
cmpl $-0x1, %eax
je 0x6a663
movl %eax, %ebx
movl %eax, %edi
callq 0x26600
cmpl $-0x1, %eax
je 0x6a65c
movl %ebx, %edi
callq 0x26180
cmpl $-0x1, %eax
je 0x6a65c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl %ebx, %edi
callq 0x26180
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x52f07(%rip), %rsi     # 0xbd57d
pushq $0x3
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2b699
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelGenerateInitialMonitorEvents
void sentinelGenerateInitialMonitorEvents(void) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetIterator(sentinel.masters);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);
        sentinelEvent(LL_WARNING,"+monitor",ri,"%@ quorum %d",ri->quorum);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0xa4079(%rip), %rdi     # 0x10e710
callq 0x2a99f
movq %rax, %rbx
leaq 0x528a1(%rip), %r14     # 0xbcf47
leaq 0x528a3(%rip), %r15     # 0xbcf50
pushq $0x3
popq %rbp
movq %rbx, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6a6d9
movq 0x8(%rax), %rdx
movl 0x90(%rdx), %r8d
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x6a7bb
jmp 0x6a6b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2aa94
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: createSentinelAddr
sentinelAddr *createSentinelAddr(char *hostname, int port) {
    char ip[NET_IP_STR_LEN];
    sentinelAddr *sa;

    if (port < 0 || port > 65535) {
        errno = EINVAL;
        return NULL;
    }
    if (anetResolve(NULL,hostname,ip,sizeof(ip)) == ANET_ERR) {
        errno = ENOENT;
        return NULL;
    }
    sa = zmalloc(sizeof(*sa));
    sa->ip = sdsnew(ip);
    sa->port = port;
    return sa;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
cmpl $0x10000, %esi          # imm = 0x10000
jb 0x6a709
callq 0x26880
movl $0x16, (%rax)
jmp 0x6a745
movq %rdi, %rsi
movq %rsp, %rdx
pushq $0x2e
popq %rcx
xorl %edi, %edi
callq 0x295d3
cmpl $-0x1, %eax
je 0x6a73a
pushq $0x10
popq %rdi
callq 0x327b9
movq %rax, %r14
movq %rsp, %rdi
callq 0x3115a
movq %rax, (%r14)
movl %ebx, 0x8(%r14)
jmp 0x6a748
callq 0x26880
movl $0x2, (%rax)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: dupSentinelAddr
sentinelAddr *dupSentinelAddr(sentinelAddr *src) {
    sentinelAddr *sa;

    sa = zmalloc(sizeof(*sa));
    sa->ip = sdsnew(src->ip);
    sa->port = src->port;
    return sa;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x327b9
movq %rax, %r14
movq (%rbx), %rdi
callq 0x3115a
movq %rax, (%r14)
movl 0x8(%rbx), %eax
movl %eax, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelReleaseScriptJob
void sentinelReleaseScriptJob(sentinelScriptJob *sj) {
    int j = 0;

    while(sj->argv[j]) sdsfree(sj->argv[j++]);
    zfree(sj->argv);
    zfree(sj);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
movq (%rdi,%r14), %rax
testq %rax, %rax
je 0x6ac15
movq %rax, %rdi
callq 0x311c8
addq $0x8, %r14
jmp 0x6abfa
callq 0x328f9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x328f9
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelGetScriptListNodeByPid
listNode *sentinelGetScriptListNodeByPid(pid_t pid) {
    listNode *ln;
    listIter li;

    listRewind(sentinel.scripts_queue,&li);
    while ((ln = listNext(&li)) != NULL) {
        sentinelScriptJob *sj = ln->value;

        if ((sj->flags & SENTINEL_SCRIPT_RUNNING) && sj->pid == pid)
            return ln;
    }
    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
movq 0xa3af7(%rip), %rdi     # 0x10e730
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2702c
movq %r14, %rdi
callq 0x27046
testq %rax, %rax
je 0x6ac61
movq 0x10(%rax), %rcx
testb $0x1, (%rcx)
je 0x6ac46
cmpl %ebx, 0x18(%rcx)
jne 0x6ac46
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelRunPendingScripts
void sentinelRunPendingScripts(void) {
    listNode *ln;
    listIter li;
    mstime_t now = mstime();

    /* Find jobs that are not running and run them, from the top to the
     * tail of the queue, so we run older jobs first. */
    listRewind(sentinel.scripts_queue,&li);
    while (sentinel.running_scripts < SENTINEL_SCRIPT_MAX_RUNNING &&
           (ln = listNext(&li)) != NULL)
    {
        sentinelScriptJob *sj = ln->value;
        pid_t pid;

        /* Skip if already running. */
        if (sj->flags & SENTINEL_SCRIPT_RUNNING) continue;

        /* Skip if it's a retry, but not enough time has elapsed. */
        if (sj->start_time && sj->start_time > now) continue;

        sj->flags |= SENTINEL_SCRIPT_RUNNING;
        sj->start_time = mstime();
        sj->retry_num++;
        pid = fork();

        if (pid == -1) {
            /* Parent (fork error).
             * We report fork errors as signal 99, in order to unify the
             * reporting with other kind of errors. */
            sentinelEvent(LL_WARNING,"-script-error",NULL,
                          "%s %d %d", sj->argv[0], 99, 0);
            sj->flags &= ~SENTINEL_SCRIPT_RUNNING;
            sj->pid = 0;
        } else if (pid == 0) {
            /* Child */
            execve(sj->argv[0],sj->argv,environ);
            /* If we are here an error occurred. */
            _exit(2); /* Don't retry execution. */
        } else {
            sentinel.running_scripts++;
            sj->pid = pid;
            sentinelEvent(LL_DEBUG,"+script-child",NULL,"%ld",(long)pid);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x2b8ae
movq %rax, %rbx
movq 0xa3aaa(%rip), %rdi     # 0x10e730
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2702c
pushq $0x63
popq %r13
leaq 0x5230d(%rip), %r15     # 0xbcfab
leaq 0x43dd9(%rip), %r12     # 0xaea7e
cmpl $0xf, 0xa3a70(%rip)     # 0x10e71c
jg 0x6ad56
movq %r14, %rdi
callq 0x27046
testq %rax, %rax
je 0x6ad56
movq 0x10(%rax), %rbp
movl (%rbp), %eax
testb $0x1, %al
jne 0x6aca5
movq 0x10(%rbp), %rcx
testq %rcx, %rcx
setne %dl
cmpq %rbx, %rcx
setg %cl
testb %cl, %dl
jne 0x6aca5
orl $0x1, %eax
movl %eax, (%rbp)
callq 0x2b8ae
movq %rax, 0x10(%rbp)
incl 0x4(%rbp)
callq 0x26ab0
cmpl $-0x1, %eax
je 0x6ad21
testl %eax, %eax
je 0x6ad65
incl 0xa3a14(%rip)           # 0x10e71c
movl %eax, 0x18(%rbp)
movslq %eax, %r8
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x6a7bb
jmp 0x6aca5
movq 0x8(%rbp), %rax
movq (%rax), %r8
andl $0x0, (%rsp)
pushq $0x3
popq %rdi
leaq 0x52267(%rip), %rsi     # 0xbcf9d
xorl %edx, %edx
leaq 0x526a2(%rip), %rcx     # 0xbd3e1
movl %r13d, %r9d
xorl %eax, %eax
callq 0x6a7bb
andb $-0x2, (%rbp)
andl $0x0, 0x18(%rbp)
jmp 0x6aca5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbp), %rsi
movq (%rsi), %rdi
movq 0x8a1ad(%rip), %rax     # 0xf4f20
movq (%rax), %rdx
callq 0x26780
pushq $0x2
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelKillTimedoutScripts
void sentinelKillTimedoutScripts(void) {
    listNode *ln;
    listIter li;
    mstime_t now = mstime();

    listRewind(sentinel.scripts_queue,&li);
    while ((ln = listNext(&li)) != NULL) {
        sentinelScriptJob *sj = ln->value;

        if (sj->flags & SENTINEL_SCRIPT_RUNNING &&
            (now - sj->start_time) > SENTINEL_SCRIPT_MAX_RUNTIME)
        {
            sentinelEvent(LL_WARNING,"-script-timeout",NULL,"%s %ld",
                sj->argv[0], (long)sj->pid);
            kill(sj->pid,SIGKILL);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x2b8ae
movq %rax, %rbx
movq 0xa3845(%rip), %rdi     # 0x10e730
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2702c
leaq 0x4b1b1(%rip), %r12     # 0xb60b0
pushq $0x3
popq %rbp
pushq $0x9
popq %r13
movq %r14, %rdi
callq 0x27046
testq %rax, %rax
je 0x6af5a
movq 0x10(%rax), %r15
testb $0x1, (%r15)
je 0x6af06
movq %rbx, %rax
subq 0x10(%r15), %rax
cmpq $0xea61, %rax           # imm = 0xEA61
jl 0x6af06
movq 0x8(%r15), %rax
movq (%rax), %r8
movslq 0x18(%r15), %r9
movl %ebp, %edi
leaq 0x520dc(%rip), %rsi     # 0xbd01c
xorl %edx, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x6a7bb
movl 0x18(%r15), %edi
movl %r13d, %esi
callq 0x26660
jmp 0x6af06
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelPendingScriptsCommand
void sentinelPendingScriptsCommand(client *c) {
    listNode *ln;
    listIter li;

    addReplyMultiBulkLen(c,listLength(sentinel.scripts_queue));
    listRewind(sentinel.scripts_queue,&li);
    while ((ln = listNext(&li)) != NULL) {
        sentinelScriptJob *sj = ln->value;
        int j = 0;

        addReplyMultiBulkLen(c,10);

        addReplyBulkCString(c,"argv");
        while (sj->argv[j]) j++;
        addReplyMultiBulkLen(c,j);
        j = 0;
        while (sj->argv[j]) addReplyBulkCString(c,sj->argv[j++]);

        addReplyBulkCString(c,"flags");
        addReplyBulkCString(c,
            (sj->flags & SENTINEL_SCRIPT_RUNNING) ? "running" : "scheduled");

        addReplyBulkCString(c,"pid");
        addReplyBulkLongLong(c,sj->pid);

        if (sj->flags & SENTINEL_SCRIPT_RUNNING) {
            addReplyBulkCString(c,"run-time");
            addReplyBulkLongLong(c,mstime() - sj->start_time);
        } else {
            mstime_t delay = sj->start_time ? (sj->start_time-mstime()) : 0;
            if (delay < 0) delay = 0;
            addReplyBulkCString(c,"run-delay");
            addReplyBulkLongLong(c,delay);
        }

        addReplyBulkCString(c,"retry-num");
        addReplyBulkLongLong(c,sj->retry_num);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0xa37af(%rip), %rax     # 0x10e730
movq 0x28(%rax), %rsi
callq 0x370d9
movq 0xa379f(%rip), %rdi     # 0x10e730
leaq 0x8(%rsp), %rsi
callq 0x2702c
leaq 0x5208f(%rip), %r13     # 0xbd031
leaq 0x45725(%rip), %rbp     # 0xb06ce
leaq 0x5209c(%rip), %r15     # 0xbd04c
leaq 0x8(%rsp), %rdi
callq 0x27046
testq %rax, %rax
je 0x6b0d2
movq 0x10(%rax), %r14
movq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x370d9
movq %rbx, %rdi
leaq 0x52050(%rip), %rsi     # 0xbd02c
callq 0x36f5d
movq 0x8(%r14), %rax
pushq $-0x1
popq %rsi
cmpq $0x0, 0x8(%rax,%rsi,8)
leaq 0x1(%rsi), %rsi
jne 0x6afe8
movq %rbx, %rdi
callq 0x370d9
xorl %r12d, %r12d
movq 0x8(%r14), %rax
movq (%rax,%r12), %rsi
movq %rbx, %rdi
testq %rsi, %rsi
je 0x6b01a
callq 0x36f5d
addq $0x8, %r12
jmp 0x6afff
leaq 0x4d6fa(%rip), %rsi     # 0xb871b
callq 0x36f5d
testb $0x1, (%r14)
movq %r13, %rsi
leaq 0x4bd82(%rip), %rax     # 0xb6db6
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x36f5d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x36f5d
movslq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x37206
testb $0x1, (%r14)
jne 0x6b070
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x6b08d
callq 0x2b8ae
subq %rax, %r12
jmp 0x6b090
movq %rbx, %rdi
leaq 0x51fbf(%rip), %rsi     # 0xbd039
callq 0x36f5d
callq 0x2b8ae
movq %rax, %r12
subq 0x10(%r14), %r12
jmp 0x6b0ab
xorl %r12d, %r12d
testq %r12, %r12
movl $0x0, %eax
cmovleq %rax, %r12
movq %rbx, %rdi
leaq 0x51f9c(%rip), %rsi     # 0xbd042
callq 0x36f5d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x37206
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36f5d
movslq 0x4(%r14), %rsi
movq %rbx, %rdi
callq 0x37206
jmp 0x6afb0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelCallClientReconfScript
void sentinelCallClientReconfScript(sentinelRedisInstance *master, int role, char *state, sentinelAddr *from, sentinelAddr *to) {
    char fromport[32], toport[32];

    if (master->client_reconfig_script == NULL) return;
    ll2string(fromport,sizeof(fromport),from->port);
    ll2string(toport,sizeof(toport),to->port);
    sentinelScheduleScriptExecution(master->client_reconfig_script,
        master->name,
        (role == SENTINEL_LEADER) ? "leader" : "observer",
        state, from->ip, fromport, to->ip, toport, NULL);
}

// Assembly:
cmpq $0x0, 0x128(%rdi)
je 0x6b18c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r13
movslq 0x8(%rcx), %rdx
leaq 0x40(%rsp), %rdi
pushq $0x20
popq %r14
movq %r14, %rsi
callq 0x39796
movslq 0x8(%r15), %rdx
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x39796
movq 0x8(%r13), %rsi
movq 0x128(%r13), %rdi
cmpl $0x20000, %ebp          # imm = 0x20000
leaq 0x52c53(%rip), %rax     # 0xbdd9c
leaq 0x51f06(%rip), %rdx     # 0xbd056
cmoveq %rax, %rdx
movq (%r12), %r8
movq (%r15), %rax
leaq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movq %rax, (%rsp)
movq %rbx, %rcx
leaq 0x40(%rsp), %r9
xorl %eax, %eax
callq 0x6aa35
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: createInstanceLink
instanceLink *createInstanceLink(void) {
    instanceLink *link = zmalloc(sizeof(*link));

    link->refcount = 1;
    link->disconnected = 1;
    link->pending_commands = 0;
    link->cc = NULL;
    link->pc = NULL;
    link->cc_conn_time = 0;
    link->pc_conn_time = 0;
    link->last_reconn_time = 0;
    link->pc_last_activity = 0;
    /* We set the act_ping_time to "now" even if we actually don't have yet
     * a connection with the node, nor we sent a ping.
     * This is useful to detect a timeout in case we'll not be able to connect
     * with the node at all. */
    link->act_ping_time = mstime();
    link->last_ping_time = 0;
    link->last_avail_time = mstime();
    link->last_pong_time = mstime();
    return link;
}

// Assembly:
pushq %rbx
pushq $0x60
popq %rdi
callq 0x327b9
movq %rax, %rbx
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%rbx)
andl $0x0, 0x8(%rbx)
andq $0x0, 0x58(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
andq $0x0, 0x30(%rbx)
callq 0x2b8ae
movq %rax, 0x40(%rbx)
andq $0x0, 0x48(%rbx)
callq 0x2b8ae
movq %rax, 0x38(%rbx)
callq 0x2b8ae
movq %rax, 0x50(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: instanceLinkCloseConnection
void instanceLinkCloseConnection(instanceLink *link, redisAsyncContext *c) {
    if (c == NULL) return;

    if (link->cc == c) {
        link->cc = NULL;
        link->pending_commands = 0;
    }
    if (link->pc == c) link->pc = NULL;
    c->data = NULL;
    link->disconnected = 1;
    redisAsyncFree(c);
}

// Assembly:
testq %rsi, %rsi
je 0x6b21a
cmpq %rsi, 0x10(%rdi)
jne 0x6b1f8
andq $0x0, 0x10(%rdi)
andl $0x0, 0x8(%rdi)
cmpq %rsi, 0x18(%rdi)
jne 0x6b203
andq $0x0, 0x18(%rdi)
andq $0x0, 0xb0(%rsi)
movl $0x1, 0x4(%rdi)
movq %rsi, %rdi
jmp 0x74fa1
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: releaseInstanceLink
instanceLink *releaseInstanceLink(instanceLink *link, sentinelRedisInstance *ri)
{
    serverAssert(link->refcount > 0);
    link->refcount--;
    if (link->refcount != 0) {
        if (ri && ri->link->cc) {
            /* This instance may have pending callbacks in the hiredis async
             * context, having as 'privdata' the instance that we are going to
             * free. Let's rewrite the callback list, directly exploiting
             * hiredis internal data structures, in order to bind them with
             * a callback that will ignore the reply at all. */
            redisCallback *cb;
            redisCallbackList *callbacks = &link->cc->replies;

            cb = callbacks->head;
            while(cb) {
                if (cb->privdata == ri) {
                    cb->fn = sentinelDiscardReplyCallback;
                    cb->privdata = NULL; /* Not strictly needed. */
                }
                cb = cb->next;
            }
        }
        return link; /* Other active users. */
    }

    instanceLinkCloseConnection(link,link->cc);
    instanceLinkCloseConnection(link,link->pc);
    zfree(link);
    return NULL;
}

// Assembly:
pushq %rbx
movl (%rdi), %eax
testl %eax, %eax
jle 0x6b28b
movq %rdi, %rbx
decl %eax
movl %eax, (%rdi)
je 0x6b264
testq %rsi, %rsi
je 0x6b286
movq 0x28(%rsi), %rax
cmpq $0x0, 0x10(%rax)
je 0x6b286
movl $0xf8, %eax
addq 0x10(%rbx), %rax
leaq 0x60(%rip), %rcx        # 0x6b2ab
movq (%rax), %rax
testq %rax, %rax
je 0x6b286
cmpq %rsi, 0x10(%rax)
jne 0x6b24b
movq %rcx, 0x8(%rax)
andq $0x0, 0x10(%rax)
jmp 0x6b24b
movq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0x6b1e4
movq 0x18(%rbx), %rsi
movq %rbx, %rdi
callq 0x6b1e4
movq %rbx, %rdi
callq 0x328f9
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
leaq 0x51dcd(%rip), %rdi     # 0xbd05f
leaq 0x51c03(%rip), %rsi     # 0xbce9c
movl $0x3d0, %edx            # imm = 0x3D0
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelTryConnectionSharing
int sentinelTryConnectionSharing(sentinelRedisInstance *ri) {
    serverAssert(ri->flags & SRI_SENTINEL);
    dictIterator *di;
    dictEntry *de;

    if (ri->runid == NULL) return C_ERR; /* No way to identify it. */
    if (ri->link->refcount > 1) return C_ERR; /* Already shared. */

    di = dictGetIterator(sentinel.masters);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *master = dictGetVal(de), *match;
        /* We want to share with the same physical Sentinel referenced
         * in other masters, so skip our master. */
        if (master == ri->master) continue;
        match = getSentinelRedisInstanceByAddrAndRunID(master->sentinels,
                                                       NULL,0,ri->runid);
        if (match == NULL) continue; /* No match. */
        if (match == ri) continue; /* Should never happen but... safer. */

        /* We identified a matching Sentinel, great! Let's free our link
         * and use the one of the matching Sentinel. */
        releaseInstanceLink(ri->link,NULL);
        ri->link = match->link;
        match->link->refcount++;
        return C_OK;
    }
    dictReleaseIterator(di);
    return C_ERR;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testb $0x4, (%rdi)
je 0x6b362
movq %rdi, %r14
pushq $-0x1
popq %rbx
cmpq $0x0, 0x10(%rdi)
je 0x6b354
movq 0x28(%r14), %rax
cmpl $0x1, (%rax)
jg 0x6b354
movq 0xa3427(%rip), %rdi     # 0x10e710
callq 0x2a99f
movq %rax, %r15
movq %r15, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6b34c
movq 0x8(%rax), %rax
cmpq 0xb8(%r14), %rax
je 0x6b2f1
movq 0x80(%rax), %rdi
movq 0x10(%r14), %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x6b382
movq %rax, %r12
testq %rax, %rax
sete %al
cmpq %r14, %r12
sete %cl
orb %al, %cl
jne 0x6b2f1
movq 0x28(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x6b21b
movq 0x28(%r12), %rax
movq %rax, 0x28(%r14)
incl (%rax)
jmp 0x6b354
movq %r15, %rdi
callq 0x2aa94
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x51d09(%rip), %rdi     # 0xbd072
leaq 0x51b2c(%rip), %rsi     # 0xbce9c
movl $0x3fb, %edx            # imm = 0x3FB
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: getSentinelRedisInstanceByAddrAndRunID
sentinelRedisInstance *getSentinelRedisInstanceByAddrAndRunID(dict *instances, char *ip, int port, char *runid) {
    dictIterator *di;
    dictEntry *de;
    sentinelRedisInstance *instance = NULL;

    serverAssert(ip || runid);   /* User must pass at least one search param. */
    di = dictGetIterator(instances);
    while((de = dictNext(di)) != NULL) {
        sentinelRedisInstance *ri = dictGetVal(de);

        if (runid && !ri->runid) continue;
        if ((runid == NULL || strcmp(ri->runid, runid) == 0) &&
            (ip == NULL || (strcmp(ri->addr->ip, ip) == 0 &&
                            ri->addr->port == port)))
        {
            instance = ri;
            break;
        }
    }
    dictReleaseIterator(di);
    return instance;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
orq %rcx, %rax
je 0x6b410
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
callq 0x2a99f
movq %rax, %r15
movq %r15, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6b3f3
movq 0x8(%rax), %r12
testq %rbx, %rbx
je 0x6b3d1
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x6b3a5
movq %rbx, %rsi
callq 0x268f0
testl %eax, %eax
jne 0x6b3a5
testq %r14, %r14
je 0x6b3f6
movq 0x20(%r12), %r13
movq (%r13), %rdi
movq %r14, %rsi
callq 0x268f0
testl %eax, %eax
jne 0x6b3a5
cmpl %ebp, 0x8(%r13)
jne 0x6b3a5
jmp 0x6b3f6
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x2aa94
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x51d1b(%rip), %rdi     # 0xbd132
leaq 0x51a7e(%rip), %rsi     # 0xbce9c
movl $0x533, %edx            # imm = 0x533
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelUpdateSentinelAddressInAllMasters
int sentinelUpdateSentinelAddressInAllMasters(sentinelRedisInstance *ri) {
    serverAssert(ri->flags & SRI_SENTINEL);
    dictIterator *di;
    dictEntry *de;
    int reconfigured = 0;

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

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testb $0x4, (%rdi)
je 0x6b504
movq %rdi, %rbx
movq 0xa32c5(%rip), %rdi     # 0x10e710
callq 0x2a99f
movq %rax, %r15
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6b4ca
movq 0x8(%rax), %rax
movq 0x80(%rax), %rdi
movq 0x10(%rbx), %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x6b382
testq %rax, %rax
je 0x6b456
movq %rax, %r12
movq 0x28(%rax), %rdi
movq 0x10(%rdi), %rsi
testq %rsi, %rsi
je 0x6b49a
callq 0x6b1e4
movq 0x28(%r12), %rdi
movq 0x18(%rdi), %rsi
testq %rsi, %rsi
je 0x6b4a8
callq 0x6b1e4
cmpq %rbx, %r12
je 0x6b456
movq 0x20(%r12), %rdi
callq 0x6a782
movq 0x20(%rbx), %rdi
callq 0x6a753
movq %rax, 0x20(%r12)
incl %r14d
jmp 0x6b456
movq %r15, %rdi
callq 0x2aa94
testl %r14d, %r14d
je 0x6b4f5
leaq 0x51bad(%rip), %rsi     # 0xbd08b
leaq 0x51bbf(%rip), %rcx     # 0xbd0a4
pushq $0x2
popq %rdi
movq %rbx, %rdx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x6a7bb
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x51b67(%rip), %rdi     # 0xbd072
leaq 0x5198a(%rip), %rsi     # 0xbce9c
movl $0x41f, %edx            # imm = 0x41F
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelRedisInstanceLookupSlave
sentinelRedisInstance *sentinelRedisInstanceLookupSlave(
                sentinelRedisInstance *ri, char *ip, int port)
{
    sds key;
    sentinelRedisInstance *slave;
    char buf[NET_PEER_ID_LEN];

    serverAssert(ri->flags & SRI_MASTER);
    anetFormatAddr(buf,sizeof(buf),ip,port);
    key = sdsnew(buf);
    slave = dictFetchValue(ri->slaves,key);
    sdsfree(key);
    return slave;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
testb $0x1, (%rdi)
je 0x6b81d
movl %edx, %ecx
movq %rsi, %rdx
movq %rdi, %rbx
movq %rsp, %r14
pushq $0x4e
popq %rsi
movq %r14, %rdi
callq 0x29e9c
movq %r14, %rdi
callq 0x3115a
movq %rax, %r14
movq 0x88(%rbx), %rdi
movq %rax, %rsi
callq 0x2a900
movq %rax, %rbx
movq %r14, %rdi
callq 0x311c8
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
leaq 0x518f7(%rip), %rdi     # 0xbd11b
leaq 0x51671(%rip), %rsi     # 0xbce9c
movl $0x4f9, %edx            # imm = 0x4F9
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/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 0x6b8a7
movq %rsi, %rbx
movq %rdi, %r14
movq 0x80(%rdi), %rdi
callq 0x2a9c4
movq %rax, %r15
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6b89d
movq 0x8(%rax), %r12
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x6b861
movq %rbx, %rsi
callq 0x268f0
testl %eax, %eax
jne 0x6b861
movq 0x80(%r14), %rdi
movq 0x8(%r12), %rsi
callq 0x2a6dc
incl %ebp
jmp 0x6b861
movq %r15, %rdi
callq 0x2aa94
jmp 0x6b8a9
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3115a
movq %rax, %rbx
movq 0xa2e49(%rip), %rdi     # 0x10e710
movq %rax, %rsi
callq 0x2a900
movq %rax, %r14
movq %rbx, %rdi
callq 0x311c8
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2a99f
movq %rax, %r14
movq %r14, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6b908
movq 0x8(%rax), %rax
orl %ebx, (%rax)
jmp 0x6b8f3
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2aa94
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
testb $0x1, (%rdi)
je 0x6ba7f
movl %esi, %ebp
movq %rdi, %rbx
movq 0x88(%rdi), %rdi
callq 0x2a8da
leaq 0x8d941(%rip), %rdi     # 0xf92b0
xorl %esi, %esi
callq 0x2a155
movq %rax, 0x88(%rbx)
testb $0x1, %bpl
jne 0x6b9a4
movq 0x80(%rbx), %rdi
callq 0x2a8da
leaq 0x8d91a(%rip), %rdi     # 0xf92b0
xorl %esi, %esi
callq 0x2a155
movq %rax, 0x80(%rbx)
movq 0x28(%rbx), %rdi
movq 0x10(%rdi), %rsi
callq 0x6b1e4
movq 0x28(%rbx), %rdi
movq 0x18(%rdi), %rsi
callq 0x6b1e4
andl $0x1, (%rbx)
movq 0xd8(%rbx), %rdi
testq %rdi, %rdi
je 0x6b9da
callq 0x311c8
andq $0x0, 0xd8(%rbx)
andl $0x0, 0xf0(%rbx)
andq $0x0, 0x118(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xf8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x311c8
movq 0xc0(%rbx), %rdi
callq 0x311c8
andq $0x0, 0x10(%rbx)
andq $0x0, 0xc0(%rbx)
callq 0x2b8ae
movq 0x28(%rbx), %rcx
movq %rax, 0x40(%rcx)
andq $0x0, 0x48(%rcx)
callq 0x2b8ae
movq 0x28(%rbx), %rcx
movq %rax, 0x38(%rcx)
callq 0x2b8ae
movq 0x28(%rbx), %rcx
movq %rax, 0x50(%rcx)
callq 0x2b8ae
movq %rax, 0x70(%rbx)
movl $0x1, 0x68(%rbx)
btl $0x10, %ebp
jb 0x6ba5e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x516d9(%rip), %rsi     # 0xbd13e
leaq 0x516e0(%rip), %rcx     # 0xbd14c
pushq $0x3
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6a7bb
leaq 0x51695(%rip), %rdi     # 0xbd11b
leaq 0x5140f(%rip), %rsi     # 0xbce9c
movl $0x577, %edx            # imm = 0x577
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/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, %ebx
movq %rdi, %r14
movq 0xa2c5d(%rip), %rdi     # 0x10e710
callq 0x2a99f
movq %rax, %r15
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6baf4
movq 0x8(%rax), %r12
movq 0x8(%r12), %rsi
testq %rsi, %rsi
je 0x6babd
movq %r14, %rdi
xorl %edx, %edx
callq 0x39506
testl %eax, %eax
je 0x6babd
movq %r12, %rdi
movl %ebx, %esi
callq 0x6b94b
incl %ebp
jmp 0x6babd
movq %r15, %rdi
callq 0x2aa94
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6bcb5
movq %rsi, %rbx
callq 0x2b8ae
movq %rax, %rcx
subq %r14, %rcx
xorl %eax, %eax
cmpq %rbx, %rcx
setg %al
jmp 0x6bcb8
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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)
andq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x6bd48
callq 0x2a99f
movq %rax, %r14
movq %r14, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x6bd36
movq 0x8(%rax), %rax
movq 0x58(%rbx), %rcx
movq %rcx, 0x58(%rax)
jmp 0x6bd1b
movq %r14, %rdi
callq 0x2aa94
movq 0x8(%rsp,%r15,8), %rdi
incq %r15
jmp 0x6bd0e
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6c74a
movq 0xb8(%rbx), %rax
movq 0x98(%rax), %r8
testq %r8, %r8
je 0x6c77f
leaq -0x14b2(%rip), %rax     # 0x6b2ab
leaq 0x50e65(%rip), %rcx     # 0xbd5c9
movq %rsi, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x7597e
testl %eax, %eax
jne 0x6c77f
movq 0x28(%rbx), %rax
incl 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x50e37(%rip), %rdx     # 0xbd5d1
leaq 0xa1f37(%rip), %rcx     # 0x10e6d8
movq %rsp, %r15
pushq $0x40
popq %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x26120
leaq -0x150d(%rip), %rsi     # 0x6b2ab
leaq 0x50e23(%rip), %rcx     # 0xbd5e2
movq %r14, %rdi
movq %rbx, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x7597e
testl %eax, %eax
jne 0x6c7da
movq 0x28(%rbx), %rax
incl 0x8(%rax)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6ca36
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x20
popq %rdi
callq 0x327b9
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movl 0x84(%rbx), %ecx
movl %ecx, 0x10(%rax)
andq $0x0, 0x14(%rax)
leaq 0x2e6a(%rip), %rcx      # 0x6f8ce
movq %rcx, 0xc0(%rbx)
leaq 0x2e85(%rip), %rcx      # 0x6f8f7
movq %rcx, 0xc8(%rbx)
leaq 0x2e94(%rip), %rcx      # 0x6f914
movq %rcx, 0xd0(%rbx)
leaq 0x2eaf(%rip), %rcx      # 0x6f93d
movq %rcx, 0xd8(%rbx)
leaq 0x2ebe(%rip), %rcx      # 0x6f95a
movq %rcx, 0xe0(%rbx)
movq %rax, 0xb8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq