LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelTimer
void sentinelTimer(void) {
    sentinelCheckTiltCondition();
    sentinelHandleDictOfRedisInstances(sentinel.masters);
    sentinelRunPendingScripts();
    sentinelCollectTerminatedScripts();
    sentinelKillTimedoutScripts();

    /* We continuously change the frequency of the Redis "timer interrupt"
     * in order to desynchronize every Sentinel from every other.
     * This non-determinism avoids that Sentinels started at the same time
     * exactly continue to stay synchronized asking to be voted at the
     * same time again and again (resulting in nobody likely winning the
     * election because of split brain voting). */
    server.hz = CONFIG_DEFAULT_HZ + rand() % CONFIG_DEFAULT_HZ;
}

// Assembly:
pushq %rax
callq 0x6f840
movq 0x9ee70(%rip), %rdi     # 0x10e710
callq 0x6f7d1
callq 0x6ac69
callq 0x6ad95
callq 0x6aece
callq 0x26b70
pushq $0xa
popq %rcx
cltd
idivl %ecx
addl $0xa, %edx
leaq 0x89fdf(%rip), %rax     # 0xf98a8
movl %edx, 0x20(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: redisAeAddRead
static void redisAeAddRead(void *privdata) {
    redisAeEvents *e = (redisAeEvents*)privdata;
    aeEventLoop *loop = e->loop;
    if (!e->reading) {
        e->reading = 1;
        aeCreateFileEvent(loop,e->fd,AE_READABLE,redisAeReadEvent,e);
    }
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
je 0x6f8d5
retq
movq %rdi, %r8
movq 0x8(%rdi), %rdi
movl $0x1, 0x14(%r8)
movl 0x10(%r8), %esi
leaq 0x85(%rip), %rcx        # 0x6f974
pushq $0x1
popq %rdx
jmp 0x28ae8
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: redisAeDelRead
static void redisAeDelRead(void *privdata) {
    redisAeEvents *e = (redisAeEvents*)privdata;
    aeEventLoop *loop = e->loop;
    if (e->reading) {
        e->reading = 0;
        aeDeleteFileEvent(loop,e->fd,AE_READABLE);
    }
}

// Assembly:
cmpl $0x0, 0x14(%rdi)
je 0x6f913
movq 0x8(%rdi), %rax
andl $0x0, 0x14(%rdi)
movl 0x10(%rdi), %esi
pushq $0x1
popq %rdx
movq %rax, %rdi
jmp 0x28ba8
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: redisAeAddWrite
static void redisAeAddWrite(void *privdata) {
    redisAeEvents *e = (redisAeEvents*)privdata;
    aeEventLoop *loop = e->loop;
    if (!e->writing) {
        e->writing = 1;
        aeCreateFileEvent(loop,e->fd,AE_WRITABLE,redisAeWriteEvent,e);
    }
}

// Assembly:
cmpl $0x0, 0x18(%rdi)
je 0x6f91b
retq
movq %rdi, %r8
movq 0x8(%rdi), %rdi
movl $0x1, 0x18(%r8)
movl 0x10(%r8), %esi
leaq 0x47(%rip), %rcx        # 0x6f97c
pushq $0x2
popq %rdx
jmp 0x28ae8
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: redisAeDelWrite
static void redisAeDelWrite(void *privdata) {
    redisAeEvents *e = (redisAeEvents*)privdata;
    aeEventLoop *loop = e->loop;
    if (e->writing) {
        e->writing = 0;
        aeDeleteFileEvent(loop,e->fd,AE_WRITABLE);
    }
}

// Assembly:
cmpl $0x0, 0x18(%rdi)
je 0x6f959
movq 0x8(%rdi), %rax
andl $0x0, 0x18(%rdi)
movl 0x10(%rdi), %esi
pushq $0x2
popq %rdx
movq %rax, %rdi
jmp 0x28ba8
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: redisAeCleanup
static void redisAeCleanup(void *privdata) {
    redisAeEvents *e = (redisAeEvents*)privdata;
    redisAeDelRead(privdata);
    redisAeDelWrite(privdata);
    zfree(e);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x6f8f7
movq %rbx, %rdi
callq 0x6f93d
movq %rbx, %rdi
popq %rbx
jmp 0x328f9
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/notify.c
// Function: keyspaceEventsStringToFlags
int keyspaceEventsStringToFlags(char *classes) {
    char *p = classes;
    int c, flags = 0;

    while((c = *p++) != '\0') {
        switch(c) {
        case 'A': flags |= NOTIFY_ALL; break;
        case 'g': flags |= NOTIFY_GENERIC; break;
        case '$': flags |= NOTIFY_STRING; break;
        case 'l': flags |= NOTIFY_LIST; break;
        case 's': flags |= NOTIFY_SET; break;
        case 'h': flags |= NOTIFY_HASH; break;
        case 'z': flags |= NOTIFY_ZSET; break;
        case 'x': flags |= NOTIFY_EXPIRED; break;
        case 'e': flags |= NOTIFY_EVICTED; break;
        case 'K': flags |= NOTIFY_KEYSPACE; break;
        case 'E': flags |= NOTIFY_KEYEVENT; break;
        default: return -1;
        }
    }
    return flags;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
xorl %eax, %eax
movl $0x8, %ecx
movl $0x2, %edx
movl $0x1, %esi
movl $0x20, %r8d
leaq 0x4ea1c(%rip), %r9      # 0xbe3c4
movl $0x4, %r10d
movl $0x40, %r11d
movl $0x10, %ebx
movzbl (%rdi), %r14d
leal -0x65(%r14), %r15d
cmpl $0x7, %r15d
jbe 0x6f9f8
cmpl $0x24, %r14d
je 0x6fa17
cmpl $0x41, %r14d
je 0x6fa2f
cmpl $0x45, %r14d
je 0x6fa24
cmpl $0x4b, %r14d
je 0x6fa20
cmpl $0x73, %r14d
je 0x6fa1b
cmpl $0x78, %r14d
je 0x6fa28
cmpl $0x7a, %r14d
jne 0x6fa3e
movl $0x80, %ebp
jmp 0x6fa34
movslq (%r9,%r15,4), %r14
addq %r9, %r14
jmpq *%r14
movl $0x200, %ebp            # imm = 0x200
jmp 0x6fa34
movl %r11d, %ebp
jmp 0x6fa34
movl %ebx, %ebp
jmp 0x6fa34
movl %r10d, %ebp
jmp 0x6fa34
movl %ecx, %ebp
jmp 0x6fa34
movl %r8d, %ebp
jmp 0x6fa34
movl %esi, %ebp
jmp 0x6fa34
movl %edx, %ebp
jmp 0x6fa34
movl $0x100, %ebp            # imm = 0x100
jmp 0x6fa34
movl $0x3fc, %ebp            # imm = 0x3FC
incq %rdi
orl %ebp, %eax
jmp 0x6f9b9
testl %r14d, %r14d
je 0x6fa48
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/notify.c
// Function: keyspaceEventsFlagsToString
sds keyspaceEventsFlagsToString(int flags) {
    sds res;

    res = sdsempty();
    if ((flags & NOTIFY_ALL) == NOTIFY_ALL) {
        res = sdscatlen(res,"A",1);
    } else {
        if (flags & NOTIFY_GENERIC) res = sdscatlen(res,"g",1);
        if (flags & NOTIFY_STRING) res = sdscatlen(res,"$",1);
        if (flags & NOTIFY_LIST) res = sdscatlen(res,"l",1);
        if (flags & NOTIFY_SET) res = sdscatlen(res,"s",1);
        if (flags & NOTIFY_HASH) res = sdscatlen(res,"h",1);
        if (flags & NOTIFY_ZSET) res = sdscatlen(res,"z",1);
        if (flags & NOTIFY_EXPIRED) res = sdscatlen(res,"x",1);
        if (flags & NOTIFY_EVICTED) res = sdscatlen(res,"e",1);
    }
    if (flags & NOTIFY_KEYSPACE) res = sdscatlen(res,"K",1);
    if (flags & NOTIFY_KEYEVENT) res = sdscatlen(res,"E",1);
    return res;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x3114c
movl %ebx, %ecx
notl %ecx
testw $0x3fc, %cx             # imm = 0x3FC
jne 0x6fa6e
leaq 0x54679(%rip), %rsi     # 0xc40e2
jmp 0x6fb1c
testb $0x4, %bl
je 0x6fa85
leaq 0x4bb52(%rip), %rsi     # 0xbb5cc
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb $0x8, %bl
je 0x6fa9c
leaq 0x4e953(%rip), %rsi     # 0xbe3e4
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb $0x10, %bl
je 0x6fab3
leaq 0x4acd5(%rip), %rsi     # 0xba77d
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb $0x20, %bl
je 0x6faca
leaq 0x4db08(%rip), %rsi     # 0xbd5c7
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb $0x40, %bl
je 0x6fae1
leaq 0x5311d(%rip), %rsi     # 0xc2bf3
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb %bl, %bl
jns 0x6faf7
leaq 0x45b43(%rip), %rsi     # 0xb562f
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
btl $0x8, %ebx
jae 0x6fb0f
leaq 0x41ba1(%rip), %rsi     # 0xb16a5
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
btl $0x9, %ebx
jae 0x6fb27
leaq 0x52839(%rip), %rsi     # 0xc2355
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb $0x1, %bl
je 0x6fb3e
leaq 0x4c58e(%rip), %rsi     # 0xbc0c1
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x31758
testb $0x2, %bl
jne 0x6fb45
popq %rbx
retq
leaq 0x4a6e5(%rip), %rsi     # 0xba231
pushq $0x1
popq %rdx
movq %rax, %rdi
popq %rbx
jmp 0x31758
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/notify.c
// Function: notifyKeyspaceEvent
void notifyKeyspaceEvent(int type, char *event, robj *key, int dbid) {
    sds chan;
    robj *chanobj, *eventobj;
    int len = -1;
    char buf[24];

    /* If notifications for this class of events are off, return ASAP. */
    if (!(server.notify_keyspace_events & type)) return;

    eventobj = createStringObject(event,strlen(event));

    /* __keyspace@<db>__:<key> <event> notifications. */
    if (server.notify_keyspace_events & NOTIFY_KEYSPACE) {
        chan = sdsnewlen("__keyspace@",11);
        len = ll2string(buf,sizeof(buf),dbid);
        chan = sdscatlen(chan, buf, len);
        chan = sdscatlen(chan, "__:", 3);
        chan = sdscatsds(chan, key->ptr);
        chanobj = createObject(OBJ_STRING, chan);
        pubsubPublishMessage(chanobj, eventobj);
        decrRefCount(chanobj);
    }

    /* __keyevente@<db>__:<event> <key> notifications. */
    if (server.notify_keyspace_events & NOTIFY_KEYEVENT) {
        chan = sdsnewlen("__keyevent@",11);
        if (len == -1) len = ll2string(buf,sizeof(buf),dbid);
        chan = sdscatlen(chan, buf, len);
        chan = sdscatlen(chan, "__:", 3);
        chan = sdscatsds(chan, eventobj->ptr);
        chanobj = createObject(OBJ_STRING, chan);
        pubsubPublishMessage(chanobj, key);
        decrRefCount(chanobj);
    }
    decrRefCount(eventobj);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x89d3b(%rip), %r15     # 0xf98a8
testl %edi, 0x998(%r15)
je 0x6fcaf
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x26500
movq %r14, %rdi
movq %rax, %rsi
callq 0x39e29
movq %rax, %r14
movl 0x998(%r15), %eax
movslq %ebp, %rbp
testb $0x1, %al
movq %rbp, 0x8(%rsp)
jne 0x6fbb0
pushq $-0x1
popq %rbp
jmp 0x6fc2a
leaq 0x4e82f(%rip), %rdi     # 0xbe3e6
pushq $0xb
popq %rsi
callq 0x31018
movq %rax, %r12
leaq 0x10(%rsp), %r13
pushq $0x18
popq %rsi
movq %r13, %rdi
movq %rbp, %rdx
callq 0x39796
movl %eax, %ebp
movslq %eax, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x31758
leaq 0x4e806(%rip), %rsi     # 0xbe3f2
pushq $0x3
popq %rdx
movq %rax, %rdi
callq 0x31758
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x317de
xorl %edi, %edi
movq %rax, %rsi
callq 0x39d58
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x5685a
movq %r12, %rdi
callq 0x3a265
movl 0x998(%r15), %eax
testb $0x2, %al
je 0x6fca7
leaq 0x4e7c1(%rip), %rdi     # 0xbe3f6
pushq $0xb
popq %rsi
callq 0x31018
movq %rax, %r12
cmpl $-0x1, %ebp
jne 0x6fc59
leaq 0x10(%rsp), %rdi
pushq $0x18
popq %rsi
movq 0x8(%rsp), %rdx
callq 0x39796
movl %eax, %ebp
movslq %ebp, %rdx
leaq 0x10(%rsp), %rsi
movq %r12, %rdi
callq 0x31758
leaq 0x4e782(%rip), %rsi     # 0xbe3f2
pushq $0x3
popq %rdx
movq %rax, %rdi
callq 0x31758
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x317de
xorl %edi, %edi
movq %rax, %rsi
callq 0x39d58
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5685a
movq %r15, %rdi
callq 0x3a265
movq %r14, %rdi
callq 0x3a265
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/setproctitle.c
// Function: setproctitle
void setproctitle(const char *fmt, ...) {
	char buf[SPT_MAXTITLE + 1]; /* use buffer in case argv[0] is passed */
	va_list ap;
	char *nul;
	int len, error;

	if (!SPT.base)
		return;

	if (fmt) {
		va_start(ap, fmt);
		len = vsnprintf(buf, sizeof buf, fmt, ap);
		va_end(ap);
	} else {
		len = snprintf(buf, sizeof buf, "%s", SPT.arg0);
	}

	if (len <= 0)
		{ error = errno; goto error; }

	if (!SPT.reset) {
		memset(SPT.base, 0, SPT.end - SPT.base);
		SPT.reset = 1;
	} else {
		memset(SPT.base, 0, spt_min(sizeof buf, SPT.end - SPT.base));
	}

	len = spt_min(len, spt_min(sizeof buf, SPT.end - SPT.base) - 1);
	memcpy(SPT.base, buf, len);
	nul = &SPT.base[len];

	if (nul < SPT.nul) {
		*SPT.nul = '.';
	} else if (nul == SPT.nul && &nul[1] < SPT.end) {
		*SPT.nul = ' ';
		*++nul = '\0';
	}

	return;
error:
	SPT.error = error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x6feee
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpq $0x0, 0x9e862(%rip)     # 0x10e758
je 0x7000a
movq %rdi, %r10
testq %rdi, %rdi
je 0x6ff40
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x200(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %r10, %rdx
callq 0x26810
jmp 0x6ff62
movq 0x9e809(%rip), %rcx     # 0x10e750
leaq 0x4d678(%rip), %rdx     # 0xbd5c6
leaq 0xd0(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x26120
movl %eax, %ebp
testl %eax, %eax
jle 0x7000a
movq 0x9e7e5(%rip), %rbx     # 0x10e758
movq 0x9e7e6(%rip), %r12     # 0x10e760
movq %r12, %r15
subq %rbx, %r15
cmpb $0x0, 0x9e7e9(%rip)     # 0x10e770
je 0x6ffa5
movl $0x100, %r14d           # imm = 0x100
cmpq %r14, %r15
cmovbq %r15, %r14
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x26110
jmp 0x6ffc6
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x26110
movb $0x1, 0x9e7b7(%rip)     # 0x10e770
movl $0x100, %r14d           # imm = 0x100
cmpq %r14, %r15
cmovbq %r15, %r14
movl %ebp, %eax
decq %r14
cmpq %r14, %rax
cmovbq %rax, %r14
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x26c50
addq %rbx, %r14
movq 0x9e779(%rip), %rax     # 0x10e768
cmpq %rax, %r14
jae 0x6fff9
movb $0x2e, (%rax)
jmp 0x7000a
jne 0x7000a
incq %r14
cmpq %r12, %r14
jae 0x7000a
movb $0x20, (%rax)
movb $0x0, (%r14)
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/blocked.c
// Function: getTimeoutFromObjectOrReply
int getTimeoutFromObjectOrReply(client *c, robj *object, mstime_t *timeout, int unit) {
    long long tval;

    if (getLongLongFromObjectOrReply(c,object,&tval,
        "timeout is not an integer or out of range") != C_OK)
        return C_ERR;

    if (tval < 0) {
        addReplyError(c,"timeout is negative");
        return C_ERR;
    }

    if (tval > 0) {
        if (unit == UNIT_SECONDS) tval *= 1000;
        tval += mstime();
    }
    *timeout = tval;

    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %r15
leaq 0x4e3e6(%rip), %rcx     # 0xbe418
movq %rsp, %rdx
callq 0x3ab03
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0x70081
movq (%rsp), %rax
testq %rax, %rax
js 0x7006b
xorl %ebx, %ebx
testq %rax, %rax
je 0x7007c
testl %ebp, %ebp
jne 0x70060
imulq $0x3e8, %rax, %rax      # imm = 0x3E8
movq %rax, (%rsp)
callq 0x2b8ae
addq (%rsp), %rax
jmp 0x7007e
leaq 0x4e3d0(%rip), %rsi     # 0xbe442
movq %r15, %rdi
callq 0x36b6f
jmp 0x70081
xorl %eax, %eax
movq %rax, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/blocked.c
// Function: processUnblockedClients
void processUnblockedClients(void) {
    listNode *ln;
    client *c;

    while (listLength(server.unblocked_clients)) {
        ln = listFirst(server.unblocked_clients);
        serverAssert(ln != NULL);
        c = ln->value;
        listDelNode(server.unblocked_clients,ln);
        c->flags &= ~CLIENT_UNBLOCKED;

        /* Process remaining data in the input buffer, unless the client
         * is blocked again. Actually processInputBuffer() checks that the
         * client is not blocked before to proceed, but things may change and
         * the code is conceptually more correct this way. */
        if (!(c->flags & CLIENT_BLOCKED)) {
            if (c->querybuf && sdslen(c->querybuf) > 0) {
                processInputBuffer(c);
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x897f3(%rip), %r14     # 0xf98a8
leaq 0x4e348(%rip), %r15     # 0xbe404
movq 0x920(%r14), %rdi
cmpq $0x0, 0x28(%rdi)
je 0x7013c
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x70142
movq 0x10(%rsi), %rbx
callq 0x26fa8
movl 0x98(%rbx), %eax
movl %eax, %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movl %ecx, 0x98(%rbx)
testb $0x10, %al
jne 0x700bc
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x700bc
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x700bc
movslq (%r15,%rdx,4), %rdx
addq %r15, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x7012d
movq -0x11(%rcx), %rax
jmp 0x7012d
movzwl -0x5(%rcx), %eax
jmp 0x7012d
movl -0x9(%rcx), %eax
jmp 0x7012d
movzbl -0x3(%rcx), %eax
testq %rax, %rax
je 0x700bc
movq %rbx, %rdi
callq 0x38231
jmp 0x700bc
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4185f(%rip), %rdi     # 0xb19a8
leaq 0x4e306(%rip), %rsi     # 0xbe456
pushq $0x73
popq %rdx
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/blocked.c
// Function: unblockClient
void unblockClient(client *c) {
    if (c->btype == BLOCKED_LIST) {
        unblockClientWaitingData(c);
    } else if (c->btype == BLOCKED_WAIT) {
        unblockClientWaitingReplicas(c);
    } else {
        serverPanic("Unknown btype in unblockClient().");
    }
    /* Clear the flags, and put the client in the unblocked list so that
     * we'll process new commands in its query buffer ASAP. */
    c->flags &= ~CLIENT_BLOCKED;
    c->btype = BLOCKED_NONE;
    server.bpop_blocked_clients--;
    /* The client may already be into the unblocked list because of a previous
     * blocking operation, don't add back it into the list multiple times. */
    if (!(c->flags & CLIENT_UNBLOCKED)) {
        c->flags |= CLIENT_UNBLOCKED;
        listAddNodeTail(server.unblocked_clients,c);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x168(%rdi), %eax
cmpl $0x2, %eax
je 0x7017e
cmpl $0x1, %eax
jne 0x701cc
movq %rbx, %rdi
callq 0x454de
jmp 0x70186
movq %rbx, %rdi
callq 0x3fe02
movl 0x98(%rbx), %edx
movl %edx, %eax
andl $-0x11, %eax
movl %eax, 0x98(%rbx)
andl $0x0, 0x168(%rbx)
leaq 0x89703(%rip), %rcx     # 0xf98a8
decl 0x918(%rcx)
testb %dl, %dl
js 0x701ca
orl $0x80, %eax
movl %eax, 0x98(%rbx)
movq 0x920(%rcx), %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x26ecc
popq %rbx
retq
leaq 0x4e28d(%rip), %rdi     # 0xbe460
leaq 0x4e27c(%rip), %rsi     # 0xbe456
movl $0x8c, %edx
callq 0x57b45
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/blocked.c
// Function: replyToBlockedClientTimedOut
void replyToBlockedClientTimedOut(client *c) {
    if (c->btype == BLOCKED_LIST) {
        addReply(c,shared.nullmultibulk);
    } else if (c->btype == BLOCKED_WAIT) {
        addReplyLongLong(c,replicationCountAcksByOffset(c->bpop.reploffset));
    } else {
        serverPanic("Unknown btype in replyToBlockedClientTimedOut().");
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x168(%rdi), %eax
cmpl $0x2, %eax
je 0x70214
cmpl $0x1, %eax
jne 0x7022c
leaq 0x8a109(%rip), %rax     # 0xfa310
movq 0x58(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x36987
movq 0x190(%rbx), %rdi
callq 0x3fce5
movslq %eax, %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x370a6
leaq 0x4e251(%rip), %rdi     # 0xbe484
leaq 0x4e21c(%rip), %rsi     # 0xbe456
movl $0xa3, %edx
callq 0x57b45
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/blocked.c
// Function: disconnectAllBlockedClients
void disconnectAllBlockedClients(void) {
    listNode *ln;
    listIter li;

    listRewind(server.clients,&li);
    while((ln = listNext(&li))) {
        client *c = listNodeValue(ln);

        if (c->flags & CLIENT_BLOCKED) {
            addReplySds(c,sdsnew(
                "-UNBLOCKED force unblock from blocking operation, "
                "instance state changed (master -> slave?)\r\n"));
            unblockClient(c);
            c->flags |= CLIENT_CLOSE_AFTER_REPLY;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8964c(%rip), %rax     # 0xf98a8
movq 0x1c8(%rax), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x2702c
leaq 0x4e242(%rip), %r14     # 0xbe4b7
movq %rbx, %rdi
callq 0x27046
testq %rax, %rax
je 0x702b5
movq 0x10(%rax), %r15
testb $0x10, 0x98(%r15)
je 0x70275
movq %r14, %rdi
callq 0x3115a
movq %r15, %rdi
movq %rax, %rsi
callq 0x36a9d
movq %r15, %rdi
callq 0x70160
orb $0x40, 0x98(%r15)
jmp 0x70275
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: MurmurHash64A
uint64_t MurmurHash64A (const void * key, int len, unsigned int seed) {
    const uint64_t m = 0xc6a4a7935bd1e995;
    const int r = 47;
    uint64_t h = seed ^ (len * m);
    const uint8_t *data = (const uint8_t *)key;
    const uint8_t *end = data + (len-(len&7));

    while(data != end) {
        uint64_t k;

#if (BYTE_ORDER == LITTLE_ENDIAN)
        k = *((uint64_t*)data);
#else
        k = (uint64_t) data[0];
        k |= (uint64_t) data[1] << 8;
        k |= (uint64_t) data[2] << 16;
        k |= (uint64_t) data[3] << 24;
        k |= (uint64_t) data[4] << 32;
        k |= (uint64_t) data[5] << 40;
        k |= (uint64_t) data[6] << 48;
        k |= (uint64_t) data[7] << 56;
#endif

        k *= m;
        k ^= k >> r;
        k *= m;
        h ^= k;
        h *= m;
        data += 8;
    }

    switch(len & 7) {
    case 7: h ^= (uint64_t)data[6] << 48;
    case 6: h ^= (uint64_t)data[5] << 40;
    case 5: h ^= (uint64_t)data[4] << 32;
    case 4: h ^= (uint64_t)data[3] << 24;
    case 3: h ^= (uint64_t)data[2] << 16;
    case 2: h ^= (uint64_t)data[1] << 8;
    case 1: h ^= (uint64_t)data[0];
            h *= m;
    };

    h ^= h >> r;
    h *= m;
    h ^= h >> r;
    return h;
}

// Assembly:
movabsq $-0x395b586ca42e166b, %rax # imm = 0xC6A4A7935BD1E995
movl %edx, %r8d
movslq %esi, %rdx
movq %rdx, %rcx
imulq %rax, %rcx
xorq %r8, %rcx
andq $-0x8, %rdx
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x7030c
movq (%rdi,%r8), %r9
imulq %rax, %r9
movq %r9, %r10
shrq $0x2f, %r10
xorq %r9, %r10
imulq %rax, %r10
xorq %rcx, %r10
imulq %rax, %r10
addq $0x8, %r8
movq %r10, %rcx
jmp 0x702e1
andl $0x7, %esi
leaq 0x4e202(%rip), %r8      # 0xbe518
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
movzbl 0x6(%rdi,%rdx), %esi
shlq $0x30, %rsi
xorq %rsi, %rcx
movzbl 0x5(%rdi,%rdx), %esi
shlq $0x28, %rsi
xorq %rsi, %rcx
movzbl 0x4(%rdi,%rdx), %esi
shlq $0x20, %rsi
xorq %rsi, %rcx
movzbl 0x3(%rdi,%rdx), %esi
shll $0x18, %esi
xorq %rsi, %rcx
movzbl 0x2(%rdi,%rdx), %esi
shll $0x10, %esi
xorq %rsi, %rcx
movzbl 0x1(%rdi,%rdx), %esi
shll $0x8, %esi
xorq %rsi, %rcx
movzbl (%rdi,%rdx), %edx
xorq %rcx, %rdx
imulq %rax, %rdx
movq %rdx, %rcx
movq %rcx, %rdx
shrq $0x2f, %rdx
xorq %rcx, %rdx
imulq %rax, %rdx
movq %rdx, %rax
shrq $0x2f, %rax
xorq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: hllDenseAdd
int hllDenseAdd(uint8_t *registers, unsigned char *ele, size_t elesize) {
    uint8_t oldcount, count;
    long index;

    /* Update the register if this element produced a longer run of zeroes. */
    count = hllPatLen(ele,elesize,&index);
    HLL_DENSE_GET_REGISTER(oldcount,registers,index);
    if (count > oldcount) {
        HLL_DENSE_SET_REGISTER(registers,index,count);
        return 1;
    } else {
        return 0;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq %rsi, %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x7038b
movl %eax, %r8d
imulq $0x6, (%r14), %rdi
pushq $0x8
popq %rsi
movq %rdi, %rax
cqto
idivq %rsi
andl $0x6, %edi
movzbl (%rbx,%rax), %r9d
movq %r9, %r10
movl %edi, %ecx
shrq %cl, %r10
subq %rdi, %rsi
movzbl 0x1(%rbx,%rax), %edx
movl %edx, %r11d
movl %esi, %ecx
shll %cl, %r11d
orl %r11d, %r10d
andl $0x3f, %r10d
movzbl %r8b, %r8d
xorl %ecx, %ecx
cmpl %r10d, %r8d
jbe 0x70453
movb $0x3f, %r10b
movl %edi, %ecx
shlb %cl, %r10b
movl %r8d, %r8d
notb %r10b
movq %r8, %r11
shlq %cl, %r11
andb %r9b, %r10b
orb %r10b, %r11b
movb %r11b, (%rbx,%rax)
pushq $-0x40
popq %rdi
movl %esi, %ecx
sarl %cl, %edi
shrq %cl, %r8
andb %dl, %dil
orb %dil, %r8b
movb %r8b, 0x1(%rbx,%rax)
pushq $0x1
popq %rcx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: hllSparseSum
double hllSparseSum(uint8_t *sparse, int sparselen, double *PE, int *ezp, int *invalid) {
    double E = 0;
    int ez = 0, idx = 0, runlen, regval;
    uint8_t *end = sparse+sparselen, *p = sparse;

    while(p < end) {
        if (HLL_SPARSE_IS_ZERO(p)) {
            runlen = HLL_SPARSE_ZERO_LEN(p);
            idx += runlen;
            ez += runlen;
            /* Increment E at the end of the loop. */
            p++;
        } else if (HLL_SPARSE_IS_XZERO(p)) {
            runlen = HLL_SPARSE_XZERO_LEN(p);
            idx += runlen;
            ez += runlen;
            /* Increment E at the end of the loop. */
            p += 2;
        } else {
            runlen = HLL_SPARSE_VAL_LEN(p);
            regval = HLL_SPARSE_VAL_VALUE(p);
            idx += runlen;
            E += PE[regval]*runlen;
            p++;
        }
    }
    if (idx != HLL_REGISTERS && invalid) *invalid = 1;
    E += ez; /* Add 2^0 'ez' times. */
    *ezp = ez;
    return E;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq %esi, %r9
addq %rdi, %r9
xorpd %xmm0, %xmm0
xorl %esi, %esi
movabsq $0x2, %r10
movabsq $0x1, %r11
xorl %eax, %eax
cmpq %r9, %rdi
jae 0x70da8
movzbl (%rdi), %r14d
movl %r14d, %ebx
andl $-0x40, %ebx
cmpl $0x40, %ebx
je 0x70d64
testl %ebx, %ebx
jne 0x70d83
leal 0x1(%r14), %ebx
addl %r14d, %eax
incl %eax
jmp 0x70d9e
andl $0x3f, %r14d
shll $0x8, %r14d
movzbl 0x1(%rdi), %ebx
leal (%r14,%rbx), %r15d
addl %r14d, %ebx
incl %ebx
addl %r15d, %eax
incl %eax
movq %r10, %r14
jmp 0x70da1
movl %r14d, %ebx
andl $0x3, %ebx
incl %ebx
andl $0x7c, %r14d
cvtsi2sd %ebx, %xmm1
mulsd 0x8(%rdx,%r14,2), %xmm1
addsd %xmm1, %xmm0
movq %r11, %r14
addq %r14, %rdi
addl %ebx, %esi
jmp 0x70d41
testq %r8, %r8
je 0x70dbc
cmpl $0x4000, %esi           # imm = 0x4000
je 0x70dbc
movl $0x1, (%r8)
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: hllRawSum
double hllRawSum(uint8_t *registers, double *PE, int *ezp) {
    double E = 0;
    int j, ez = 0;
    uint64_t *word = (uint64_t*) registers;
    uint8_t *bytes;

    for (j = 0; j < HLL_REGISTERS/8; j++) {
        if (*word == 0) {
            ez += 8;
        } else {
            bytes = (uint8_t*) word;
            if (bytes[0]) E += PE[bytes[0]]; else ez++;
            if (bytes[1]) E += PE[bytes[1]]; else ez++;
            if (bytes[2]) E += PE[bytes[2]]; else ez++;
            if (bytes[3]) E += PE[bytes[3]]; else ez++;
            if (bytes[4]) E += PE[bytes[4]]; else ez++;
            if (bytes[5]) E += PE[bytes[5]]; else ez++;
            if (bytes[6]) E += PE[bytes[6]]; else ez++;
            if (bytes[7]) E += PE[bytes[7]]; else ez++;
        }
        word++;
    }
    E += ez; /* 2^(-reg[j]) is 1 when m is 0, add it 'ez' times for every
                zero register in the HLL. */
    *ezp = ez;
    return E;
}

// Assembly:
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
xorl %eax, %eax
cmpl $0x800, %ecx            # imm = 0x800
je 0x70ebf
movq (%rdi,%rcx,8), %r8
testq %r8, %r8
je 0x70dfa
testb %r8b, %r8b
je 0x70e02
movzbl %r8b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70e04
addl $0x8, %eax
jmp 0x70eb7
incl %eax
testw $0xff00, %r8w           # imm = 0xFF00
je 0x70e1f
movq %r8, %r9
shrq $0x8, %r9
movzbl %r9b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70e21
incl %eax
testl $0xff0000, %r8d         # imm = 0xFF0000
je 0x70e3d
movq %r8, %r9
shrq $0x10, %r9
movzbl %r9b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70e3f
incl %eax
movq %r8, %r9
shrq $0x18, %r9
testb %r9b, %r9b
je 0x70e57
movzbl %r9b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70e59
incl %eax
movq %r8, %r9
shrq $0x20, %r9
testb %r9b, %r9b
je 0x70e71
movzbl %r9b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70e73
incl %eax
movq %r8, %r9
shrq $0x28, %r9
testb %r9b, %r9b
je 0x70e8b
movzbl %r9b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70e8d
incl %eax
movq %r8, %r9
shrq $0x30, %r9
testb %r9b, %r9b
je 0x70ea5
movzbl %r9b, %r9d
addsd (%rsi,%r9,8), %xmm0
jmp 0x70ea7
incl %eax
shrq $0x38, %r8
jne 0x70eb1
incl %eax
jmp 0x70eb7
addsd (%rsi,%r8,8), %xmm0
incq %rcx
jmp 0x70dd4
cvtsi2sd %eax, %xmm1
addsd %xmm1, %xmm0
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: hllAdd
int hllAdd(robj *o, unsigned char *ele, size_t elesize) {
    struct hllhdr *hdr = o->ptr;
    switch(hdr->encoding) {
    case HLL_DENSE: return hllDenseAdd(hdr->registers,ele,elesize);
    case HLL_SPARSE: return hllSparseAdd(o,ele,elesize);
    default: return -1; /* Invalid representation. */
    }
}

// Assembly:
movq %rdi, %rax
movq 0x8(%rdi), %rdi
movzbl 0x4(%rdi), %ecx
cmpl $0x1, %ecx
je 0x710b5
testl %ecx, %ecx
jne 0x710bd
addq $0x10, %rdi
jmp 0x703c1
movq %rax, %rdi
jmp 0x7089b
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: hllMerge
int hllMerge(uint8_t *max, robj *hll) {
    struct hllhdr *hdr = hll->ptr;
    int i;

    if (hdr->encoding == HLL_DENSE) {
        uint8_t val;

        for (i = 0; i < HLL_REGISTERS; i++) {
            HLL_DENSE_GET_REGISTER(val,hdr->registers,i);
            if (val > max[i]) max[i] = val;
        }
    } else {
        uint8_t *p = hll->ptr, *end = p + sdslen(hll->ptr);
        long runlen, regval;

        p += HLL_HDR_SIZE;
        i = 0;
        while(p < end) {
            if (HLL_SPARSE_IS_ZERO(p)) {
                runlen = HLL_SPARSE_ZERO_LEN(p);
                i += runlen;
                p++;
            } else if (HLL_SPARSE_IS_XZERO(p)) {
                runlen = HLL_SPARSE_XZERO_LEN(p);
                i += runlen;
                p += 2;
            } else {
                runlen = HLL_SPARSE_VAL_LEN(p);
                regval = HLL_SPARSE_VAL_VALUE(p);
                while(runlen--) {
                    if (regval > max[i]) max[i] = regval;
                    i++;
                }
                p++;
            }
        }
        if (i != HLL_REGISTERS) return C_ERR;
    }
    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %r14
cmpb $0x0, 0x4(%r14)
je 0x71171
movq %r14, %rdi
callq 0x70863
addq %r14, %rax
addq $0x10, %r14
xorl %ecx, %ecx
pushq $0x2
popq %rdx
pushq $0x1
popq %rsi
cmpq %rax, %r14
jae 0x71165
movzbl (%r14), %edi
movl %edi, %r8d
andl $-0x40, %r8d
cmpl $0x40, %r8d
je 0x7110f
testl %r8d, %r8d
jne 0x71126
addl %edi, %ecx
incl %ecx
jmp 0x7115d
andl $0x3f, %edi
shll $0x8, %edi
movzbl 0x1(%r14), %r8d
addl %edi, %ecx
addl %r8d, %ecx
incl %ecx
movq %rdx, %rdi
jmp 0x71160
movl %edi, %r8d
andl $0x3, %r8d
incq %r8
shrl $0x2, %edi
andl $0x1f, %edi
leal 0x1(%rdi), %r9d
movslq %ecx, %r10
addq %rbx, %r10
xorl %r11d, %r11d
cmpq %r11, %r8
je 0x7115a
movzbl (%r10,%r11), %ebp
cmpl %ebp, %edi
jb 0x71155
movb %r9b, (%r10,%r11)
incq %r11
jmp 0x71143
addl %r11d, %ecx
movq %rsi, %rdi
addq %rdi, %r14
jmp 0x710ee
cmpl $0x4000, %ecx           # imm = 0x4000
jne 0x711aa
xorl %eax, %eax
jmp 0x711ad
xorl %eax, %eax
cmpq $0x18000, %rax          # imm = 0x18000
je 0x7116d
movl %eax, %ecx
shrl $0x3, %ecx
movzbl 0x10(%r14,%rcx), %esi
movzbl 0x11(%r14,%rcx), %edx
shll $0x8, %edx
orl %esi, %edx
movl %eax, %ecx
andb $0x7, %cl
shrl %cl, %edx
andb $0x3f, %dl
cmpb (%rbx), %dl
jbe 0x711a1
movb %dl, (%rbx)
addq $0x6, %rax
incq %rbx
jmp 0x71173
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: createHLLObject
robj *createHLLObject(void) {
    robj *o;
    struct hllhdr *hdr;
    sds s;
    uint8_t *p;
    int sparselen = HLL_HDR_SIZE +
                    (((HLL_REGISTERS+(HLL_SPARSE_XZERO_MAX_LEN-1)) /
                     HLL_SPARSE_XZERO_MAX_LEN)*2);
    int aux;

    /* Populate the sparse representation with as many XZERO opcodes as
     * needed to represent all the registers. */
    aux = HLL_REGISTERS;
    s = sdsnewlen(NULL,sparselen);
    p = (uint8_t*)s + HLL_HDR_SIZE;
    while(aux) {
        int xzero = HLL_SPARSE_XZERO_MAX_LEN;
        if (xzero > aux) xzero = aux;
        HLL_SPARSE_XZERO_SET(p,xzero);
        p += 2;
        aux -= xzero;
    }
    serverAssert((p-(uint8_t*)s) == sparselen);

    /* Create the actual object. */
    o = createObject(OBJ_STRING,s);
    hdr = o->ptr;
    memcpy(hdr->magic,"HYLL",4);
    hdr->encoding = HLL_SPARSE;
    return o;
}

// Assembly:
pushq %rax
pushq $0x12
popq %rsi
xorl %edi, %edi
callq 0x31018
movl $0x4000, %edx           # imm = 0x4000
pushq $0x10
popq %rcx
movl $0x4000, %esi           # imm = 0x4000
testl %esi, %esi
je 0x711f8
cmpl %edx, %esi
movl $0x4000, %edi           # imm = 0x4000
cmovll %esi, %edi
leal -0x1(%rdi), %r8d
movl %r8d, %r9d
shrl $0x8, %r9d
orb $0x40, %r9b
movb %r9b, (%rax,%rcx)
movb %r8b, 0x1(%rax,%rcx)
subl %edi, %esi
addq $0x2, %rcx
jmp 0x711ca
cmpq $0x12, %rcx
jne 0x71218
xorl %edi, %edi
movq %rax, %rsi
callq 0x39d58
movq 0x8(%rax), %rcx
movl $0x4c4c5948, (%rcx)     # imm = 0x4C4C5948
movb $0x1, 0x4(%rcx)
popq %rcx
retq
leaq 0x4d3e6(%rip), %rdi     # 0xbe605
leaq 0x4d3a4(%rip), %rsi     # 0xbe5ca
movl $0x457, %edx            # imm = 0x457
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: isHLLObjectOrReply
int isHLLObjectOrReply(client *c, robj *o) {
    struct hllhdr *hdr;

    /* Key exists, check type */
    if (checkType(c,o,OBJ_STRING))
        return C_ERR; /* Error already sent. */

    if (!sdsEncodedObject(o)) goto invalid;
    if (stringObjectLen(o) < sizeof(*hdr)) goto invalid;
    hdr = o->ptr;

    /* Magic should be "HYLL". */
    if (hdr->magic[0] != 'H' || hdr->magic[1] != 'Y' ||
        hdr->magic[2] != 'L' || hdr->magic[3] != 'L') goto invalid;

    if (hdr->encoding > HLL_MAX_ENCODING) goto invalid;

    /* Dense representation string length should match exactly. */
    if (hdr->encoding == HLL_DENSE &&
        stringObjectLen(o) != HLL_DENSE_SIZE) goto invalid;

    /* All tests passed. */
    return C_OK;

invalid:
    addReplySds(c,
        sdsnew("-WRONGTYPE Key is not a valid "
               "HyperLogLog string value.\r\n"));
    return C_ERR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %edx, %edx
callq 0x3a311
pushq $-0x1
popq %r15
testl %eax, %eax
jne 0x712a5
movl (%r14), %eax
shrl $0x4, %eax
testb $0x7, %al
jne 0x7128e
movq %r14, %rdi
callq 0x3a747
cmpq $0x10, %rax
jb 0x7128e
movq 0x8(%r14), %rax
cmpb $0x48, (%rax)
jne 0x7128e
cmpb $0x59, 0x1(%rax)
jne 0x7128e
cmpb $0x4c, 0x2(%rax)
jne 0x7128e
cmpb $0x4c, 0x3(%rax)
jne 0x7128e
movb 0x4(%rax), %al
cmpb $0x1, %al
jbe 0x712b5
leaq 0x4d38d(%rip), %rdi     # 0xbe622
callq 0x3115a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x36a9d
movl %r15d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
testb %al, %al
jne 0x712a8
movq %r14, %rdi
callq 0x3a747
cmpq $0x3010, %rax           # imm = 0x3010
jne 0x7128e
jmp 0x712a8
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: pfaddCommand
void pfaddCommand(client *c) {
    robj *o = lookupKeyWrite(c->db,c->argv[1]);
    struct hllhdr *hdr;
    int updated = 0, j;

    if (o == NULL) {
        /* Create the key with a string value of the exact length to
         * hold our HLL data structure. sdsnewlen() when NULL is passed
         * is guaranteed to return bytes initialized to zero. */
        o = createHLLObject();
        dbAdd(c->db,c->argv[1],o);
        updated++;
    } else {
        if (isHLLObjectOrReply(c,o) != C_OK) return;
        o = dbUnshareStringValue(c->db,c->argv[1],o);
    }
    /* Perform the low level ADD operation for every element. */
    for (j = 2; j < c->argc; j++) {
        int retval = hllAdd(o, (unsigned char*)c->argv[j]->ptr,
                               sdslen(c->argv[j]->ptr));
        switch(retval) {
        case 1:
            updated++;
            break;
        case -1:
            addReplySds(c,sdsnew(invalid_hll_err));
            return;
        }
    }
    hdr = o->ptr;
    if (updated) {
        signalModifiedKey(c->db,c->argv[1]);
        notifyKeyspaceEvent(NOTIFY_STRING,"pfadd",c->argv[1],c->db->id);
        server.dirty++;
        HLL_INVALIDATE_CACHE(hdr);
    }
    addReply(c, updated ? shared.cone : shared.czero);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x3aec2
testq %rax, %rax
je 0x71309
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x71238
testl %eax, %eax
je 0x7132a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x711b2
movq %rax, %r14
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdx
callq 0x3af45
pushq $0x1
popq %rbp
jmp 0x71343
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdx
callq 0x3b27c
movq %rax, %r14
xorl %ebp, %ebp
pushq $0x2
popq %r12
movslq 0x38(%rbx), %rax
cmpq %rax, %r12
jge 0x71385
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rax), %r15
movq %r15, %rdi
callq 0x70863
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x71098
cmpl $0x1, %eax
je 0x7137e
cmpl $-0x1, %eax
jne 0x71380
jmp 0x713f2
incl %ebp
incq %r12
jmp 0x71347
testl %ebp, %ebp
je 0x713cf
movq 0x8(%r14), %r14
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x3b125
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x3d500(%rip), %rsi     # 0xae8b4
pushq $0x8
popq %rdi
callq 0x6fb58
leaq 0x884e5(%rip), %rax     # 0xf98a8
incq 0x720(%rax)
orb $-0x80, 0xf(%r14)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x88f33(%rip), %rcx     # 0xfa310
movq 0x20(%rcx,%rax,8), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x36987
leaq 0x4d3bf(%rip), %rdi     # 0xbe7b8
callq 0x3115a
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x36a9d
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/latency.c
// Function: THPIsEnabled
int THPIsEnabled(void) {
    char buf[1024];

    FILE *fp = fopen("/sys/kernel/mm/transparent_hugepage/enabled","r");
    if (!fp) return 0;
    if (fgets(buf,sizeof(buf),fp) == NULL) {
        fclose(fp);
        return 0;
    }
    fclose(fp);
    return (strstr(buf,"[never]") == NULL) ? 1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
leaq 0x4ca0e(%rip), %rdi     # 0xbe80c
leaq 0x3f890(%rip), %rsi     # 0xb1695
callq 0x26ae0
xorl %ebx, %ebx
testq %rax, %rax
je 0x71e4b
movq %rax, %r14
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x26440
movq %rax, %r15
movq %r14, %rdi
callq 0x26a10
testq %r15, %r15
je 0x71e4b
leaq 0x4c9fd(%rip), %rsi     # 0xbe838
movq %rsp, %rdi
callq 0x266b0
xorl %ebx, %ebx
testq %rax, %rax
sete %bl
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/latency.c
// Function: latencyAddSample
void latencyAddSample(char *event, mstime_t latency) {
    struct latencyTimeSeries *ts = dictFetchValue(server.latency_events,event);
    time_t now = time(NULL);
    int prev;

    /* Create the time series if it does not exist. */
    if (ts == NULL) {
        ts = zmalloc(sizeof(*ts));
        ts->idx = 0;
        ts->max = 0;
        memset(ts->samples,0,sizeof(ts->samples));
        dictAdd(server.latency_events,zstrdup(event),ts);
    }

    /* If the previous sample is in the same second, we update our old sample
     * if this latency is > of the old one, or just return. */
    prev = (ts->idx + LATENCY_TS_LEN - 1) % LATENCY_TS_LEN;
    if (ts->samples[prev].time == now) {
        if (latency > ts->samples[prev].latency)
            ts->samples[prev].latency = latency;
        return;
    }

    ts->samples[ts->idx].time = time(NULL);
    ts->samples[ts->idx].latency = latency;
    if (latency > ts->max) ts->max = latency;

    ts->idx++;
    if (ts->idx == LATENCY_TS_LEN) ts->idx = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x87a0d(%rip), %r13     # 0xf98a8
movq 0xa20(%r13), %rdi
movq %r12, %rsi
callq 0x2a900
movq %rax, %r14
xorl %edi, %edi
callq 0x26cd0
movq %rax, %r15
testq %r14, %r14
jne 0x71ef5
movl $0x508, %edi            # imm = 0x508
callq 0x327b9
movq %rax, %r14
movl $0x508, %edx            # imm = 0x508
movq %rax, %rdi
xorl %esi, %esi
callq 0x26110
movq 0xa20(%r13), %r13
movq %r12, %rdi
callq 0x32933
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2a3ed
movl $0x9f, %eax
addl (%r14), %eax
movl $0xa0, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movslq 0x8(%r14,%rax,8), %rcx
cmpq %rcx, %r15
jne 0x71f23
movl 0xc(%r14,%rax,8), %ecx
cmpq %rbx, %rcx
jge 0x71f56
movl %ebx, 0xc(%r14,%rax,8)
jmp 0x71f56
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x26cd0
movslq (%r14), %rcx
movl %eax, 0x8(%r14,%rcx,8)
movl %ebx, 0xc(%r14,%rcx,8)
movl 0x4(%r14), %eax
cmpq %rbx, %rax
jge 0x71f47
movl %ebx, 0x4(%r14)
leal 0x1(%rcx), %eax
cmpl $0xa0, %eax
cmovnel %eax, %r15d
movl %r15d, (%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/latency.c
// Function: latencyResetEvent
int latencyResetEvent(char *event_to_reset) {
    dictIterator *di;
    dictEntry *de;
    int resets = 0;

    di = dictGetSafeIterator(server.latency_events);
    while((de = dictNext(di)) != NULL) {
        char *event = dictGetKey(de);

        if (event_to_reset == NULL || strcasecmp(event,event_to_reset) == 0) {
            dictDelete(server.latency_events, event);
            resets++;
        }
    }
    dictReleaseIterator(di);
    return resets;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x87936(%rip), %r12     # 0xf98a8
movq 0xa20(%r12), %rdi
callq 0x2a9c4
movq %rax, %r14
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x71fbc
movq (%rax), %r15
testq %rbx, %rbx
je 0x71fa8
movq %r15, %rdi
movq %rbx, %rsi
callq 0x262f0
testl %eax, %eax
jne 0x71f84
movq 0xa20(%r12), %rdi
movq %r15, %rsi
callq 0x2a6dc
incl %ebp
jmp 0x71f84
movq %r14, %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/latency.c
// Function: latencyCommandReplyWithSamples
void latencyCommandReplyWithSamples(client *c, struct latencyTimeSeries *ts) {
    void *replylen = addDeferredMultiBulkLength(c);
    int samples = 0, j;

    for (j = 0; j < LATENCY_TS_LEN; j++) {
        int i = (ts->idx + j) % LATENCY_TS_LEN;

        if (ts->samples[i].time == 0) continue;
        addReplyMultiBulkLen(c,2);
        addReplyLongLong(c,ts->samples[i].time);
        addReplyLongLong(c,ts->samples[i].latency);
        samples++;
    }
    setDeferredMultiBulkLength(c,replylen,samples);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x36dad
movq %rax, (%rsp)
xorl %ebp, %ebp
movl $0xa0, %r13d
xorl %r15d, %r15d
cmpl $0xa0, %ebp
je 0x727e2
movl (%r14), %eax
addl %ebp, %eax
cltd
idivl %r13d
movslq %edx, %r12
cmpl $0x0, 0x8(%r14,%r12,8)
je 0x727de
movq %rbx, %rdi
pushq $0x2
popq %rsi
callq 0x370d9
movslq 0x8(%r14,%r12,8), %rsi
movq %rbx, %rdi
callq 0x370a6
movl 0xc(%r14,%r12,8), %esi
movq %rbx, %rdi
callq 0x370a6
incl %r15d
incl %ebp
jmp 0x7279a
movslq %r15d, %rdx
movq %rbx, %rdi
movq (%rsp), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36de9
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/latency.c
// Function: latencyCommandReplyWithLatestEvents
void latencyCommandReplyWithLatestEvents(client *c) {
    dictIterator *di;
    dictEntry *de;

    addReplyMultiBulkLen(c,dictSize(server.latency_events));
    di = dictGetIterator(server.latency_events);
    while((de = dictNext(di)) != NULL) {
        char *event = dictGetKey(de);
        struct latencyTimeSeries *ts = dictGetVal(de);
        int last = (ts->idx + LATENCY_TS_LEN - 1) % LATENCY_TS_LEN;

        addReplyMultiBulkLen(c,4);
        addReplyBulkCString(c,event);
        addReplyLongLong(c,ts->samples[last].time);
        addReplyLongLong(c,ts->samples[last].latency);
        addReplyLongLong(c,ts->max);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x87094(%rip), %r14     # 0xf98a8
movq 0xa20(%r14), %rax
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
callq 0x370d9
movq 0xa20(%r14), %rdi
callq 0x2a99f
movq %rax, %r14
pushq $0x4
popq %r15
movq %r14, %rdi
callq 0x2a9d3
testq %rax, %rax
je 0x728a5
movq (%rax), %r12
movq 0x8(%rax), %r13
movl (%r13), %eax
movl $0x9f, %ecx
addl %ecx, %eax
cltd
movl $0xa0, %ecx
idivl %ecx
movl %edx, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x370d9
movq %rbx, %rdi
movq %r12, %rsi
callq 0x36f5d
movslq %ebp, %r12
movslq 0x8(%r13,%r12,8), %rsi
movq %rbx, %rdi
callq 0x370a6
movl 0xc(%r13,%r12,8), %esi
movq %rbx, %rdi
callq 0x370a6
movl 0x4(%r13), %esi
movq %rbx, %rdi
callq 0x370a6
jmp 0x7283b
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2aa94
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sparkline.c
// Function: createSparklineSequence
struct sequence *createSparklineSequence(void) {
    struct sequence *seq = zmalloc(sizeof(*seq));
    seq->length = 0;
    seq->samples = NULL;
    return seq;
}

// Assembly:
pushq %rax
pushq $0x20
popq %rdi
callq 0x327b9
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sparkline.c
// Function: sparklineSequenceAddSample
void sparklineSequenceAddSample(struct sequence *seq, double value, char *label) {
    label = (label == NULL || label[0] == '\0') ? NULL : zstrdup(label);
    if (seq->length == 0) {
        seq->min = seq->max = value;
    } else {
        if (value < seq->min) seq->min = value;
        else if (value > seq->max) seq->max = value;
    }
    seq->samples = zrealloc(seq->samples,sizeof(struct sample)*(seq->length+1));
    seq->samples[seq->length].value = value;
    seq->samples[seq->length].label = label;
    seq->length++;
    if (label) seq->labels++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
movsd %xmm0, (%rsp)
je 0x72ce7
cmpb $0x0, (%rsi)
je 0x72ce7
movq %rsi, %rdi
callq 0x32933
movsd (%rsp), %xmm0
movq %rax, %r14
jmp 0x72cea
xorl %r14d, %r14d
movslq (%rbx), %rsi
testq %rsi, %rsi
je 0x72d0a
movsd 0x10(%rbx), %xmm1
ucomisd %xmm0, %xmm1
ja 0x72d0f
ucomisd 0x18(%rbx), %xmm0
jbe 0x72d17
leaq 0x18(%rbx), %rax
jmp 0x72d13
movsd %xmm0, 0x18(%rbx)
leaq 0x10(%rbx), %rax
movsd %xmm0, (%rax)
movq 0x8(%rbx), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x32863
movq %rax, 0x8(%rbx)
movslq (%rbx), %rcx
leal 0x1(%rcx), %edx
shlq $0x4, %rcx
movsd (%rsp), %xmm0
movsd %xmm0, (%rax,%rcx)
movq %r14, 0x8(%rax,%rcx)
movl %edx, (%rbx)
testq %r14, %r14
je 0x72d4f
incl 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sparkline.c
// Function: freeSparklineSequence
void freeSparklineSequence(struct sequence *seq) {
    int j;

    for (j = 0; j < seq->length; j++)
        zfree(seq->samples[j].label);
    zfree(seq->samples);
    zfree(seq);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x8
popq %r14
xorl %r15d, %r15d
movslq (%rbx), %rax
movq 0x8(%rbx), %rdi
cmpq %rax, %r15
jge 0x72d84
movq (%rdi,%r14), %rdi
callq 0x328f9
incq %r15
addq $0x10, %r14
jmp 0x72d66
callq 0x328f9
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x328f9