LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: keysCommand
void keysCommand(client *c) {
    dictIterator *di;
    dictEntry *de;
    sds pattern = c->argv[1]->ptr;
    int plen = sdslen(pattern), allkeys;
    unsigned long numkeys = 0;
    void *replylen = addDeferredMultiBulkLength(c);

    di = dictGetSafeIterator(c->db->dict);
    allkeys = (pattern[0] == '*' && pattern[1] == '\0');
    while((de = dictNext(di)) != NULL) {
        sds key = dictGetKey(de);
        robj *keyobj;

        if (allkeys || stringmatchlen(pattern,plen,key,sdslen(key),0)) {
            keyobj = createStringObject(key,sdslen(key));
            if (expireIfNeeded(c->db,keyobj) == 0) {
                addReplyBulk(c,keyobj);
                numkeys++;
            }
            decrRefCount(keyobj);
        }
    }
    dictReleaseIterator(di);
    setDeferredMultiBulkLength(c,replylen,numkeys);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r14
movzbl -0x1(%r14), %eax
movq %rax, (%rsp)
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x425c8
leaq 0x7ea40(%rip), %rcx     # 0xc0e7c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsp), %rax
shrl $0x3, %eax
jmp 0x42466
movq -0x11(%r14), %rax
jmp 0x42466
movzwl -0x5(%r14), %eax
jmp 0x42466
movl -0x9(%r14), %eax
jmp 0x42466
movzbl -0x3(%r14), %eax
movq %rax, (%rsp)
movq %rbx, %rdi
callq 0x3cee9
movq %rax, 0x8(%rsp)
movq 0x10(%rbx), %rax
movq (%rax), %rdi
callq 0x2efe5
movq %rax, %r13
cmpb $0x2a, (%r14)
jne 0x42497
cmpb $0x0, 0x1(%r14)
sete %r15b
jmp 0x4249a
xorl %r15d, %r15d
movq %r13, %rdi
callq 0x2f015
testq %rax, %rax
je 0x425a0
movq %r14, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0x7e9eb(%rip), %r14     # 0xc0ea4
movq (%rax), %r12
testb %r15b, %r15b
jne 0x4251e
movzbl -0x1(%r12), %ecx
movl %ecx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x42504
leaq 0x7e9b8(%rip), %rdx     # 0xc0e90
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
shrl $0x3, %ecx
jmp 0x42506
movq -0x11(%r12), %rcx
jmp 0x42506
movzwl -0x5(%r12), %ecx
jmp 0x42506
movl -0x9(%r12), %ecx
jmp 0x42506
movzbl -0x3(%r12), %ecx
jmp 0x42506
xorl %ecx, %ecx
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x3fa30
testl %eax, %eax
je 0x4258d
movzbl -0x1(%r12), %esi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x4255a
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x4255c
movq -0x11(%r12), %rsi
jmp 0x4255c
movzwl -0x5(%r12), %esi
jmp 0x4255c
movl -0x9(%r12), %esi
jmp 0x4255c
movzbl -0x3(%r12), %esi
jmp 0x4255c
xorl %esi, %esi
movq %r12, %rdi
callq 0x40744
movq %rax, %r12
movq 0x10(%rbx), %rdi
movq %rax, %rsi
callq 0x41a1e
testl %eax, %eax
jne 0x42585
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d170
incq %rbp
movq %r12, %rdi
callq 0x40c8f
movq %r13, %rdi
callq 0x2f015
testq %rax, %rax
jne 0x424b9
jmp 0x425a2
xorl %ebp, %ebp
movq %r13, %rdi
callq 0x2f0dd
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cf25
movq $0x0, (%rsp)
jmp 0x4246a
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: scanCallback
void scanCallback(void *privdata, const dictEntry *de) {
    void **pd = (void**) privdata;
    list *keys = pd[0];
    robj *o = pd[1];
    robj *key, *val = NULL;

    if (o == NULL) {
        sds sdskey = dictGetKey(de);
        key = createStringObject(sdskey, sdslen(sdskey));
    } else if (o->type == OBJ_SET) {
        key = dictGetKey(de);
        incrRefCount(key);
    } else if (o->type == OBJ_HASH) {
        key = dictGetKey(de);
        incrRefCount(key);
        val = dictGetVal(de);
        incrRefCount(val);
    } else if (o->type == OBJ_ZSET) {
        key = dictGetKey(de);
        incrRefCount(key);
        val = createStringObjectFromLongDouble(*(double*)dictGetVal(de),0);
    } else {
        serverPanic("Type not handled in SCAN callback.");
    }

    listAddNodeTail(keys, key);
    if (val) listAddNodeTail(keys, val);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x42615
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
je 0x4265b
cmpl $0x3, %eax
je 0x4263b
cmpl $0x2, %eax
jne 0x426c1
movq (%r14), %r14
movq %r14, %rdi
callq 0x407a8
jmp 0x426ad
movq (%r14), %rdi
movzbl -0x1(%rdi), %esi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x426a3
leaq 0x7e88b(%rip), %rcx     # 0xc0eb8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x426a5
movq (%r14), %r15
movq %r15, %rdi
callq 0x407a8
movq 0x8(%r14), %rax
fldl (%rax)
fstpt (%rsp)
xorl %edi, %edi
callq 0x407ac
movq %rax, %r14
jmp 0x42672
movq (%r14), %r15
movq %r15, %rdi
callq 0x407a8
movq 0x8(%r14), %r14
movq %r14, %rdi
callq 0x407a8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2b24b
testq %r14, %r14
jne 0x426ad
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq -0x11(%rdi), %rsi
jmp 0x426a5
movzwl -0x5(%rdi), %esi
jmp 0x426a5
movl -0x9(%rdi), %esi
jmp 0x426a5
movzbl -0x3(%rdi), %esi
jmp 0x426a5
xorl %esi, %esi
callq 0x40744
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2b24b
leaq 0x7e8b1(%rip), %rdi     # 0xc0f79
leaq 0x80340(%rip), %rsi     # 0xc2a0f
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x619b4
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: parseScanCursorOrReply
int parseScanCursorOrReply(client *c, robj *o, unsigned long *cursor) {
    char *eptr;

    /* Use strtoul() because we need an *unsigned* long, so
     * getLongLongFromObject() does not cover the whole cursor space. */
    errno = 0;
    *cursor = strtoul(o->ptr, &eptr, 10);
    if (isspace(((char*)o->ptr)[0]) || eptr[0] != '\0' || errno == ERANGE)
    {
        addReplyError(c, "invalid cursor");
        return C_ERR;
    }
    return C_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
callq 0x26880
movq %rax, %r14
movl $0x0, (%rax)
movq 0x8(%r12), %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x26c20
movq %rax, (%r15)
callq 0x26560
movq (%rax), %rax
movq 0x8(%r12), %rcx
movsbq (%rcx), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
jne 0x42740
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x42740
xorl %eax, %eax
cmpl $0x22, (%r14)
jne 0x42754
leaq 0x7e857(%rip), %rsi     # 0xc0f9e
movq %rbx, %rdi
callq 0x3cc06
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: typeCommand
void typeCommand(client *c) {
    robj *o;
    char *type;

    o = lookupKeyReadWithFlags(c->db,c->argv[1],LOOKUP_NOTOUCH);
    if (o == NULL) {
        type = "none";
    } else {
        switch(o->type) {
        case OBJ_STRING: type = "string"; break;
        case OBJ_LIST: type = "list"; break;
        case OBJ_SET: type = "set"; break;
        case OBJ_ZSET: type = "zset"; break;
        case OBJ_HASH: type = "hash"; break;
        default: type = "unknown"; break;
        }
    }
    addReplyStatus(c,type);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movl $0x1, %edx
callq 0x419a5
testq %rax, %rax
je 0x42da1
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
ja 0x42daa
leaq 0x7e170(%rip), %rcx     # 0xc0f08
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x42db1
leaq 0x7e296(%rip), %rsi     # 0xc103e
jmp 0x42db1
leaq 0x7e032(%rip), %rsi     # 0xc0de3
movq %rbx, %rdi
popq %rbx
jmp 0x3cdcb
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: shutdownCommand
void shutdownCommand(client *c) {
    int flags = 0;

    if (c->argc > 2) {
        addReply(c,shared.syntaxerr);
        return;
    } else if (c->argc == 2) {
        if (!strcasecmp(c->argv[1]->ptr,"nosave")) {
            flags |= SHUTDOWN_NOSAVE;
        } else if (!strcasecmp(c->argv[1]->ptr,"save")) {
            flags |= SHUTDOWN_SAVE;
        } else {
            addReply(c,shared.syntaxerr);
            return;
        }
    }
    /* When SHUTDOWN is called while the server is loading a dataset in
     * memory we need to make sure no attempt is performed to save
     * the dataset on shutdown (otherwise it could overwrite the current DB
     * with half-read data).
     *
     * Also when in Sentinel mode clear the SAVE flag and force NOSAVE. */
    if (server.loading || server.sentinel_mode)
        flags = (flags & ~SHUTDOWN_SAVE) | SHUTDOWN_NOSAVE;
    if (prepareForShutdown(flags) == C_OK) exit(0);
    addReplyError(c,"Errors trying to SHUTDOWN. Check logs.");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x38(%rdi), %ecx
cmpl $0x3, %ecx
jl 0x42de6
leaq 0xbf540(%rip), %rax     # 0x102310
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3c854
xorl %eax, %eax
cmpl $0x2, %ecx
jne 0x42e2b
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r14
leaq 0x7e248(%rip), %rsi     # 0xc1048
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x42e26
leaq 0x7fdaa(%rip), %rsi     # 0xc2bbd
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
jne 0x42dc9
movl $0x1, %eax
jmp 0x42e2b
movl $0x2, %eax
leaq 0xbea76(%rip), %rcx     # 0x1018a8
movl 0x9c(%rcx), %edx
orl 0x31c(%rcx), %edx
movl $0x2, %edi
cmovel %eax, %edi
xorl %eax, %eax
callq 0x33cd9
testl %eax, %eax
je 0x42e67
leaq 0x7e1f7(%rip), %rsi     # 0xc104f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3cc06
xorl %edi, %edi
callq 0x262c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: getExpire
long long getExpire(redisDb *db, robj *key) {
    dictEntry *de;

    /* No expire? return ASAP */
    if (dictSize(db->expires) == 0 ||
       (de = dictFind(db->expires,key->ptr)) == NULL) return -1;

    /* The entry was found in the expire dict, this means it should also
     * be present in the main dict (safety check). */
    serverAssertWithInfo(NULL,key,dictFind(db->dict,key->ptr) != NULL);
    return dictGetSignedIntegerVal(de);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movq 0x28(%rdi), %rax
movq $-0x1, %r14
addq 0x48(%rdi), %rax
je 0x43079
movq %rsi, %rbx
movq 0x8(%rsi), %rsi
callq 0x2ebca
testq %rax, %rax
je 0x43079
movq %rax, %r12
movq (%r15), %rdi
movq 0x8(%rbx), %rsi
callq 0x2ebca
testq %rax, %rax
je 0x43088
movq 0x8(%r12), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x7e021(%rip), %rdx     # 0xc10b0
leaq 0x7f979(%rip), %rcx     # 0xc2a0f
xorl %edi, %edi
movq %rbx, %rsi
movl $0x364, %r8d            # imm = 0x364
callq 0x627c3
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: setExpire
void setExpire(redisDb *db, robj *key, long long when) {
    dictEntry *kde, *de;

    /* Reuse the sds from the main dict in the expire dict */
    kde = dictFind(db->dict,key->ptr);
    serverAssertWithInfo(NULL,key,kde != NULL);
    de = dictReplaceRaw(db->expires,dictGetKey(kde));
    dictSetSignedIntegerVal(de,when);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
movq 0x8(%rsi), %rsi
callq 0x2ebca
testq %rax, %rax
je 0x430e5
movq 0x8(%r15), %rdi
movq (%rax), %rsi
callq 0x2ec87
movq %rbx, 0x8(%rax)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x7dfe8(%rip), %rdx     # 0xc10d4
leaq 0x7f91c(%rip), %rcx     # 0xc2a0f
xorl %edi, %edi
movq %r14, %rsi
movl $0x354, %r8d            # imm = 0x354
callq 0x627c3
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: propagateExpire
void propagateExpire(redisDb *db, robj *key) {
    robj *argv[2];

    argv[0] = shared.del;
    argv[1] = key;
    incrRefCount(argv[0]);
    incrRefCount(argv[1]);

    if (server.aof_state != AOF_OFF)
        feedAppendOnlyFile(server.delCommand,db->id,argv,2);
    replicationFeedSlaves(server.slaves,db->id,argv,2);

    decrRefCount(argv[0]);
    decrRefCount(argv[1]);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xbf021(%rip), %rax     # 0x102310
movq 0x128(%rax), %rdi
movq %rdi, (%rsp)
movq %rsi, 0x8(%rsp)
callq 0x407a8
movq %r14, %rdi
callq 0x407a8
leaq 0xbe595(%rip), %r14     # 0x1018a8
cmpl $0x0, 0x668(%r14)
je 0x43334
movq 0x340(%r14), %rdi
movl 0x30(%rbx), %esi
movq %rsp, %rdx
movl $0x2, %ecx
callq 0x5dd38
movq 0x1e0(%r14), %rdi
movl 0x30(%rbx), %esi
movq %rsp, %rbx
movq %rbx, %rdx
movl $0x2, %ecx
callq 0x441a9
movq (%rbx), %rdi
callq 0x40c8f
movq 0x8(%rbx), %rdi
callq 0x40c8f
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: ttlGenericCommand
void ttlGenericCommand(client *c, int output_ms) {
    long long expire, ttl = -1;

    /* If the key does not exist at all, return -2 */
    if (lookupKeyReadWithFlags(c->db,c->argv[1],LOOKUP_NOTOUCH) == NULL) {
        addReplyLongLong(c,-2);
        return;
    }
    /* The key exists. Return -1 if it has no expire, or the actual
     * TTL value otherwise. */
    expire = getExpire(c->db,c->argv[1]);
    if (expire != -1) {
        ttl = expire-mstime();
        if (ttl < 0) ttl = 0;
    }
    if (ttl == -1) {
        addReplyLongLong(c,-1);
    } else {
        addReplyLongLong(c,output_ms ? ttl : ((ttl+500)/1000));
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movl $0x1, %edx
callq 0x419a5
testq %rax, %rax
je 0x435e6
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x4302f
cmpq $-0x1, %rax
je 0x435ef
movq %rax, %r14
callq 0x2ffce
subq %rax, %r14
xorl %esi, %esi
testq %r14, %r14
cmovgq %r14, %rsi
testl %ebp, %ebp
jne 0x435f6
addq $0x1f4, %rsi            # imm = 0x1F4
shrq $0x3, %rsi
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
movq %rsi, %rax
mulq %rcx
movq %rdx, %rsi
shrq $0x4, %rsi
jmp 0x435f6
movq $-0x2, %rsi
jmp 0x435f6
movq $-0x1, %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3d23f
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: persistCommand
void persistCommand(client *c) {
    if (lookupKeyWrite(c->db,c->argv[1])) {
        if (removeExpire(c->db,c->argv[1])) {
            addReply(c,shared.cone);
            server.dirty++;
        } else {
            addReply(c,shared.czero);
        }
    } else {
        addReply(c,shared.czero);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movq 0x40(%rdi), %rax
movq 0x8(%rax), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x41a1e
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4195c
testq %rax, %rax
je 0x43680
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41d2f
testl %eax, %eax
je 0x43680
leaq 0xbecb0(%rip), %rax     # 0x102310
movq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
leaq 0xbe235(%rip), %rax     # 0x1018a8
incq 0x720(%rax)
popq %rbx
popq %r14
popq %r15
retq
leaq 0xbec89(%rip), %rax     # 0x102310
movq 0x20(%rax), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3c854
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: touchCommand
void touchCommand(client *c) {
    int touched = 0;
    for (int j = 1; j < c->argc; j++)
        if (lookupKeyRead(c->db,c->argv[j]) != NULL) touched++;
    addReplyLongLong(c,touched);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
cmpl $0x2, 0x38(%rdi)
jl 0x436d9
movl $0x1, %r15d
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rsi
xorl %edx, %edx
callq 0x419a5
cmpq $0x1, %rax
sbbl $-0x1, %r14d
incq %r15
movslq 0x38(%rbx), %rax
cmpq %rax, %r15
jl 0x436af
movl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3d23f
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: getKeysUsingCommandTable
int *getKeysUsingCommandTable(struct redisCommand *cmd,robj **argv, int argc, int *numkeys) {
    int j, i = 0, last, *keys;
    UNUSED(argv);

    if (cmd->firstkey == 0) {
        *numkeys = 0;
        return NULL;
    }
    last = cmd->lastkey;
    if (last < 0) last = argc+last;
    keys = zmalloc(sizeof(int)*((last - cmd->firstkey)+1));
    for (j = cmd->firstkey; j <= last; j += cmd->keystep) {
        serverAssert(j < argc);
        keys[i++] = j;
    }
    *numkeys = i;
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl 0x30(%rdi), %eax
xorl %r15d, %r15d
testl %eax, %eax
je 0x43748
movl %edx, %ebp
movq %rdi, %r14
movl 0x34(%rdi), %ecx
movl %ecx, %r12d
sarl $0x1f, %r12d
andl %edx, %r12d
addl %ecx, %r12d
movl %r12d, %ecx
subl %eax, %ecx
incl %ecx
movslq %ecx, %rdi
shlq $0x2, %rdi
callq 0x382d1
movl 0x30(%r14), %ecx
cmpl %r12d, %ecx
jg 0x4374a
xorl %r15d, %r15d
cmpl %ebp, %ecx
jge 0x43756
movl %ecx, (%rax,%r15,4)
incq %r15
addl 0x38(%r14), %ecx
cmpl %r12d, %ecx
jle 0x43732
jmp 0x4374a
xorl %eax, %eax
movl %r15d, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7d997(%rip), %rdi     # 0xc10f4
leaq 0x7f2ab(%rip), %rsi     # 0xc2a0f
movl $0x432, %edx            # imm = 0x432
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: zunionInterGetKeys
int *zunionInterGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, *keys;
    UNUSED(cmd);

    num = atoi(argv[2]->ptr);
    /* Sanity check. Don't return any key if the command is going to
     * reply with syntax error. */
    if (num > (argc-3)) {
        *numkeys = 0;
        return NULL;
    }

    /* Keys in z{union,inter}store come from two places:
     * argv[1] = storage key,
     * argv[3...n] = keys to intersect */
    keys = zmalloc(sizeof(int)*(num+1));

    /* Add all key positions for argv[3...n] to keys[] */
    for (i = 0; i < num; i++) keys[i] = 3+i;

    /* Finally add the argv[1] key position (the storage key target). */
    keys[num] = 1;
    *numkeys = num+1;  /* Total keys = {union,inter} keys + storage key */
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq 0x10(%rsi), %rax
movq 0x8(%rax), %rdi
callq 0x26760
addl $-0x3, %ebp
cmpl %ebp, %eax
jle 0x437b6
xorl %r14d, %r14d
xorl %eax, %eax
jmp 0x43871
movl %eax, %r14d
movslq %eax, %r15
leaq 0x4(,%r15,4), %rdi
callq 0x382d1
testl %r14d, %r14d
jle 0x43866
movl %r14d, %edx
leal 0x1(%r14), %ecx
andl $-0x2, %ecx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x7886f(%rip), %xmm1    # 0xbc060
xorl %edx, %edx
movdqa 0x78875(%rip), %xmm2    # 0xbc070
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x7d715(%rip), %xmm4    # 0xc0f20
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x43843
leal 0x3(%rdx), %esi
movl %esi, (%rax,%rdx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x43859
leal 0x4(%rdx), %esi
movl %esi, 0x4(%rax,%rdx,4)
addq $0x2, %rdx
paddq %xmm4, %xmm1
cmpq %rdx, %rcx
jne 0x4380b
incl %r14d
movl $0x1, (%rax,%r15,4)
movl %r14d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: evalGetKeys
int *evalGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, *keys;
    UNUSED(cmd);

    num = atoi(argv[2]->ptr);
    /* Sanity check. Don't return any key if the command is going to
     * reply with syntax error. */
    if (num > (argc-3)) {
        *numkeys = 0;
        return NULL;
    }

    keys = zmalloc(sizeof(int)*num);
    *numkeys = num;

    /* Add all key positions for argv[3...n] to keys[] */
    for (i = 0; i < num; i++) keys[i] = 3+i;

    return keys;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %r14
movl %edx, %ebp
movq 0x10(%rsi), %rax
movq 0x8(%rax), %rdi
callq 0x26760
addl $-0x3, %ebp
cmpl %ebp, %eax
jle 0x438aa
movl $0x0, (%r14)
xorl %eax, %eax
jmp 0x43952
movl %eax, %ebx
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x382d1
movl %ebx, (%r14)
testl %ebx, %ebx
jle 0x43952
movl %ebx, %ecx
incl %ebx
andl $-0x2, %ebx
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x78781(%rip), %xmm1    # 0xbc060
xorl %ecx, %ecx
movdqa 0x78787(%rip), %xmm2    # 0xbc070
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x7d627(%rip), %xmm4    # 0xc0f20
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x43930
leal 0x3(%rcx), %edx
movl %edx, (%rax,%rcx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x43945
leal 0x4(%rcx), %edx
movl %edx, 0x4(%rax,%rcx,4)
addq $0x2, %rcx
paddq %xmm4, %xmm1
cmpq %rcx, %rbx
jne 0x438f9
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: sortGetKeys
int *sortGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, j, num, *keys, found_store = 0;
    UNUSED(cmd);

    num = 0;
    keys = zmalloc(sizeof(int)*2); /* Alloc 2 places for the worst case. */

    keys[num++] = 1; /* <sort-key> is always present. */

    /* Search for STORE option. By default we consider options to don't
     * have arguments, so if we find an unknown option name we scan the
     * next. However there are options with 1 or 2 arguments, so we
     * provide a list here in order to skip the right number of args. */
    struct {
        char *name;
        int skip;
    } skiplist[] = {
        {"limit", 2},
        {"get", 1},
        {"by", 1},
        {NULL, 0} /* End of elements. */
    };

    for (i = 2; i < argc; i++) {
        for (j = 0; skiplist[j].name != NULL; j++) {
            if (!strcasecmp(argv[i]->ptr,skiplist[j].name)) {
                i += skiplist[j].skip;
                break;
            } else if (!strcasecmp(argv[i]->ptr,"store") && i+1 < argc) {
                /* Note: we don't increment "num" here and continue the loop
                 * to be sure to process the *last* "STORE" option if multiple
                 * ones are provided. This is same behavior as SORT. */
                found_store = 1;
                keys[num] = i+1; /* <store-key> */
                break;
            }
        }
    }
    *numkeys = num + found_store;
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movl %edx, %r15d
movq %rsi, 0x20(%rsp)
movl $0x8, %edi
callq 0x382d1
movq %rax, 0x10(%rsp)
movl $0x1, (%rax)
movl $0x1, %eax
cmpl $0x3, %r15d
jl 0x43a67
movq %rbx, 0x18(%rsp)
movl $0x2, %r13d
movq $0x0, 0x8(%rsp)
leaq 0xb6321(%rip), %rbp     # 0xf9cd0
movl %r15d, 0x4(%rsp)
movslq %r13d, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rax
movq 0x8(%rax), %rbx
movq %rbx, %rdi
leaq 0x80681(%rip), %rsi     # 0xc404f
callq 0x262f0
movq %rbp, %r14
testl %eax, %eax
je 0x43a2a
leal 0x1(%r13), %r12d
cmpl %r15d, %r12d
setge %r14b
movq %rbx, %rdi
leaq 0x78f0f(%rip), %rsi     # 0xbc8fe
callq 0x262f0
testl %eax, %eax
setne %r15b
orb %r14b, %r15b
xorl %ecx, %ecx
testb %r15b, %r15b
je 0x43a37
leaq 0x10(%rcx), %r14
cmpq $0x30, %r14
je 0x43a4a
movq 0x10(%rcx,%rbp), %rsi
movq %rbx, %rdi
callq 0x262f0
movq %r14, %rcx
testl %eax, %eax
jne 0x439ff
addq %rbp, %r14
movl 0x4(%rsp), %r15d
movl 0x8(%r14), %eax
leal (%rax,%r13), %r12d
incl %r12d
jmp 0x43a4f
movq 0x10(%rsp), %rax
movl %r12d, 0x4(%rax)
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movl 0x4(%rsp), %r15d
movl %r12d, %r13d
cmpl %r15d, %r12d
jl 0x439b4
movq 0x8(%rsp), %rax
incl %eax
movq 0x18(%rsp), %rbx
movl %eax, (%rbx)
movq 0x10(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: migrateGetKeys
int *migrateGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, first, *keys;
    UNUSED(cmd);

    /* Assume the obvious form. */
    first = 3;
    num = 1;

    /* But check for the extended one with the KEYS option. */
    if (argc > 6) {
        for (i = 6; i < argc; i++) {
            if (!strcasecmp(argv[i]->ptr,"keys") &&
                sdslen(argv[3]->ptr) == 0)
            {
                first = i+1;
                num = argc-first;
                break;
            }
        }
    }

    keys = zmalloc(sizeof(int)*num);
    for (i = 0; i < num; i++) keys[i] = first+i;
    *numkeys = num;
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movl $0x3, %ebx
movl $0x1, %r12d
cmpl $0x7, %edx
jl 0x43b48
movq %rsi, %r14
movq %r15, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %edx, %r12d
addq $-0x6, %r12
xorl %r13d, %r13d
leaq 0x850ea(%rip), %r15     # 0xc8ba9
leaq 0x7d42e(%rip), %rbp     # 0xc0ef4
movq 0x30(%r14,%r13,8), %rax
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x262f0
testl %eax, %eax
jne 0x43b1a
movq 0x18(%r14), %rax
movq 0x8(%rax), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x43b2f
movslq (%rbp,%rdx,4), %rdx
addq %rbp, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x43b15
movq -0x11(%rcx), %rax
jmp 0x43b15
movzwl -0x5(%rcx), %eax
jmp 0x43b15
movl -0x9(%rcx), %eax
jmp 0x43b15
movzbl -0x3(%rcx), %eax
testq %rax, %rax
je 0x43b2f
incq %r13
cmpq %r13, %r12
jne 0x43ac6
movq 0x10(%rsp), %r15
movl $0x1, %r12d
jmp 0x43b48
movl 0xc(%rsp), %eax
subl %r13d, %eax
addl $-0x7, %eax
addq $0x7, %r13
movl %eax, %r12d
movq %r13, %rbx
movq 0x10(%rsp), %r15
movslq %r12d, %r14
leaq (,%r14,4), %rdi
callq 0x382d1
testl %r14d, %r14d
jle 0x43bf9
movl %r12d, %edx
leal 0x1(%r12), %ecx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl %ecx
shlq $0x3, %rcx
movdqa 0x784dc(%rip), %xmm1    # 0xbc060
xorl %edx, %edx
movdqa 0x784e2(%rip), %xmm2    # 0xbc070
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x7d382(%rip), %xmm4    # 0xc0f20
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x43bd3
movl %ebx, (%rax,%rdx)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x43be9
leal 0x1(%rbx), %esi
movl %esi, 0x4(%rax,%rdx)
paddq %xmm4, %xmm1
addl $0x2, %ebx
addq $0x8, %rdx
cmpq %rdx, %rcx
jne 0x43b9e
movl %r12d, (%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: georadiusGetKeys
int *georadiusGetKeys(struct redisCommand *cmd, robj **argv, int argc, int *numkeys) {
    int i, num, *keys;
    UNUSED(cmd);

    /* Check for the presence of the stored key in the command */
    int stored_key = -1;
    for (i = 5; i < argc; i++) {
        char *arg = argv[i]->ptr;
        /* For the case when user specifies both "store" and "storedist" options, the
         * second key specified would override the first key. This behavior is kept 
         * the same as in georadiusCommand method.
         */
        if ((!strcasecmp(arg, "store") || !strcasecmp(arg, "storedist")) && ((i+1) < argc)) {
            stored_key = i+1;
            i++;
        }
    }
    num = 1 + (stored_key == -1 ? 0 : 1);

    /* Keys in the command come from two places:
     * argv[1] = key,
     * argv[5...n] = stored key if present
     */
    keys = zmalloc(sizeof(int) * num);

    /* Add all key positions to keys[] */
    keys[0] = 1;
    if(num > 1) {
         keys[1] = stored_key;
    }
    *numkeys = num; 
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x6, %edx
jl 0x43c79
movl %edx, %ebp
movq %rsi, %r14
movl $0x5, %r12d
leaq 0x78cc8(%rip), %r15     # 0xbc8fe
movslq %r12d, %rax
movq (%r14,%rax,8), %rax
movq 0x8(%rax), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x262f0
testl %eax, %eax
je 0x43c63
movq %r13, %rdi
leaq 0x7d4a3(%rip), %rsi     # 0xc10fd
callq 0x262f0
testl %eax, %eax
jne 0x43c71
leal 0x1(%r12), %eax
cmpl %ebp, %eax
cmovll %eax, %ebx
cmovll %eax, %r12d
incl %r12d
cmpl %ebp, %r12d
jl 0x43c36
xorl %eax, %eax
cmpl $-0x1, %ebx
setne %al
leal 0x4(,%rax,4), %edi
movl %eax, %ebp
incl %ebp
callq 0x382d1
movl $0x1, (%rax)
cmpl $-0x1, %ebx
je 0x43c9f
movl %ebx, 0x4(%rax)
movq (%rsp), %rcx
movl %ebp, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: getKeysInSlot
unsigned int getKeysInSlot(unsigned int hashslot, robj **keys, unsigned int count) {
    zskiplistNode *n;
    zrangespec range;
    int j = 0;

    range.min = range.max = hashslot;
    range.minex = range.maxex = 0;

    n = zslFirstInRange(server.cluster->slots_to_keys, &range);
    while(n && n->score == hashslot && count--) {
        keys[j++] = n->obj;
        n = n->level[0].forward;
    }
    return j;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movl %edi, %eax
cvtsi2sd %rax, %xmm0
movq %rsi, %rbx
leaq 0x10(%rsp), %rsi
movsd %xmm0, 0x8(%rsi)
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
leaq 0xbdbbf(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x60028(%rax), %rdi
callq 0x50364
testq %rax, %rax
je 0x43d34
movq %rax, %rcx
movl %ebp, %edx
xorl %eax, %eax
movsd 0x8(%rsp), %xmm1
movsd 0x8(%rcx), %xmm0
ucomisd %xmm1, %xmm0
jne 0x43d36
jp 0x43d36
cmpl %eax, %edx
je 0x43d36
movq (%rcx), %rsi
movq %rsi, (%rbx,%rax,8)
incq %rax
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
jne 0x43d0e
jmp 0x43d36
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: delKeysInSlot
unsigned int delKeysInSlot(unsigned int hashslot) {
    zskiplistNode *n;
    zrangespec range;
    int j = 0;

    range.min = range.max = hashslot;
    range.minex = range.maxex = 0;

    n = zslFirstInRange(server.cluster->slots_to_keys, &range);
    while(n && n->score == hashslot) {
        robj *key = n->obj;
        n = n->level[0].forward; /* Go to the next item before freeing it. */
        incrRefCount(key); /* Protect the object while freeing it. */
        dbDelete(&server.db[0],key);
        decrRefCount(key);
        j++;
    }
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %eax
cvtsi2sd %rax, %xmm0
leaq 0x10(%rsp), %rsi
movsd %xmm0, 0x8(%rsi)
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
leaq 0xbdb36(%rip), %r12     # 0x1018a8
movq 0x9b0(%r12), %rax
movq 0x60028(%rax), %rdi
callq 0x50364
testq %rax, %rax
je 0x43dcd
movq %rax, %r14
xorl %ebx, %ebx
movsd 0x8(%r14), %xmm0
ucomisd 0x8(%rsp), %xmm0
jne 0x43dcf
jp 0x43dcf
movq (%r14), %r15
movq 0x18(%r14), %r14
movq %r15, %rdi
callq 0x407a8
movq 0x28(%r12), %rdi
movq %r15, %rsi
callq 0x41e5f
movq %r15, %rdi
callq 0x40c8f
incl %ebx
testq %r14, %r14
jne 0x43d90
jmp 0x43dcf
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/db.c
// Function: countKeysInSlot
unsigned int countKeysInSlot(unsigned int hashslot) {
    zskiplist *zsl = server.cluster->slots_to_keys;
    zskiplistNode *zn;
    zrangespec range;
    int rank, count = 0;

    range.min = range.max = hashslot;
    range.minex = range.maxex = 0;

    /* Find first element in range */
    zn = zslFirstInRange(zsl, &range);

    /* Use rank of first element, if any, to determine preliminary count */
    if (zn != NULL) {
        rank = zslGetRank(zsl, zn->score, zn->obj);
        count = (zsl->length - (rank - 1));

        /* Find last element in range */
        zn = zslLastInRange(zsl, &range);

        /* Use rank of last element, if any, to determine the actual count */
        if (zn != NULL) {
            rank = zslGetRank(zsl, zn->score, zn->obj);
            count -= (zsl->length - rank);
        }
    }
    return count;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xbdabd(%rip), %rax     # 0x1018a8
movq 0x9b0(%rax), %rax
movq 0x60028(%rax), %rbx
movl %edi, %eax
cvtsi2sd %rax, %xmm0
movq %rsp, %rsi
movsd %xmm0, 0x8(%rsi)
movsd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x50364
testq %rax, %rax
je 0x43e6e
movsd 0x8(%rax), %xmm0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x507f6
movq 0x10(%rbx), %rcx
subq %rax, %rcx
movabsq $-0xffffffff, %r14      # imm = 0xFFFFFFFF00000001
addq %rcx, %r14
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x50428
testq %rax, %rax
je 0x43e71
movsd 0x8(%rax), %xmm0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x507f6
addl %eax, %r14d
subl 0x10(%rbx), %r14d
jmp 0x43e71
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationGetSlaveName
char *replicationGetSlaveName(client *c) {
    static char buf[NET_PEER_ID_LEN];
    char ip[NET_IP_STR_LEN];

    ip[0] = '\0';
    buf[0] = '\0';
    if (c->slave_ip[0] != '\0' ||
        anetPeerToString(c->fd,ip,sizeof(ip),NULL) != -1)
    {
        /* Note that the 'ip' buffer is always larger than 'c->slave_ip' */
        if (c->slave_ip[0] != '\0') memcpy(ip,c->slave_ip,sizeof(c->slave_ip));

        if (c->slave_listening_port)
            anetFormatAddr(buf,sizeof(buf),ip,c->slave_listening_port);
        else
            snprintf(buf,sizeof(buf),"%s:<unknown-slave-port>",ip);
    } else {
        snprintf(buf,sizeof(buf),"client id #%llu",
            (unsigned long long) c->id);
    }
    return buf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movb %al, (%rsp)
movb %al, 0xd22cf(%rip)      # 0x116160
leaq 0x118(%rdi), %r14
cmpb %al, 0x118(%rdi)
je 0x43edc
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x1e(%r14), %xmm2
movups %xmm2, 0x1e(%rsp)
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl 0x114(%rbx), %ecx
leaq 0xd2297(%rip), %rdi     # 0x116160
testl %ecx, %ecx
je 0x43efb
movq %rsp, %rdx
movl $0x4e, %esi
callq 0x2e363
jmp 0x43f24
movl 0x8(%rbx), %edi
movq %rsp, %rsi
movl $0x2e, %edx
xorl %ecx, %ecx
callq 0x2e279
cmpl $-0x1, %eax
je 0x43f07
cmpb $0x0, (%r14)
jne 0x43ea0
jmp 0x43ebc
leaq 0x7d2f6(%rip), %rdx     # 0xc11f8
movq %rsp, %rcx
jmp 0x43f18
movq (%rbx), %rcx
leaq 0xd224f(%rip), %rdi     # 0x116160
leaq 0x7d2f8(%rip), %rdx     # 0xc1210
movl $0x4e, %esi
xorl %eax, %eax
callq 0x26120
leaq 0xd2235(%rip), %rax     # 0x116160
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: createReplicationBacklog
void createReplicationBacklog(void) {
    serverAssert(server.repl_backlog == NULL);
    server.repl_backlog = zmalloc(server.repl_backlog_size);
    server.repl_backlog_histlen = 0;
    server.repl_backlog_idx = 0;
    /* When a new backlog buffer is created, we increment the replication
     * offset by one to make sure we'll not be able to PSYNC with any
     * previous slave. This is needed because we avoid incrementing the
     * master_repl_offset if no backlog exists nor slaves are attached. */
    server.master_repl_offset++;

    /* We don't have any data inside our buffer, but virtually the first
     * byte we have is the next byte that will be generated for the
     * replication stream. */
    server.repl_backlog_off = server.master_repl_offset+1;
}

// Assembly:
pushq %rbx
leaq 0xbd96d(%rip), %rbx     # 0x1018a8
cmpq $0x0, 0x7d0(%rbx)
jne 0x43f81
movq 0x7d8(%rbx), %rdi
callq 0x382d1
movq %rax, 0x7d0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7e0(%rbx)
movq 0x7c0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x7c0(%rbx)
addq $0x2, %rax
movq %rax, 0x7f0(%rbx)
popq %rbx
retq
leaq 0x7d298(%rip), %rdi     # 0xc1220
leaq 0x7d2ad(%rip), %rsi     # 0xc123c
movl $0x4e, %edx
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: resizeReplicationBacklog
void resizeReplicationBacklog(long long newsize) {
    if (newsize < CONFIG_REPL_BACKLOG_MIN_SIZE)
        newsize = CONFIG_REPL_BACKLOG_MIN_SIZE;
    if (server.repl_backlog_size == newsize) return;

    server.repl_backlog_size = newsize;
    if (server.repl_backlog != NULL) {
        /* What we actually do is to flush the old buffer and realloc a new
         * empty one. It will refill with new data incrementally.
         * The reason is that copying a few gigabytes adds latency and even
         * worse often we need to alloc additional space before freeing the
         * old buffer. */
        zfree(server.repl_backlog);
        server.repl_backlog = zmalloc(server.repl_backlog_size);
        server.repl_backlog_histlen = 0;
        server.repl_backlog_idx = 0;
        /* Next byte we have is... the next since the buffer is empty. */
        server.repl_backlog_off = server.master_repl_offset+1;
    }
}

// Assembly:
pushq %rbx
cmpq $0x4001, %rdi           # imm = 0x4001
movl $0x4000, %eax           # imm = 0x4000
cmovgeq %rdi, %rax
leaq 0xbd8ed(%rip), %rbx     # 0x1018a8
cmpq %rax, 0x7d8(%rbx)
je 0x4400a
movq %rax, 0x7d8(%rbx)
movq 0x7d0(%rbx), %rdi
testq %rdi, %rdi
je 0x4400a
callq 0x38413
movq 0x7d8(%rbx), %rdi
callq 0x382d1
movq %rax, 0x7d0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7e0(%rbx)
movq 0x7c0(%rbx), %rax
incq %rax
movq %rax, 0x7f0(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: feedReplicationBacklog
void feedReplicationBacklog(void *ptr, size_t len) {
    unsigned char *p = ptr;

    server.master_repl_offset += len;

    /* This is a circular buffer, so write as much data we can at every
     * iteration and rewind the "idx" index if we reach the limit. */
    while(len) {
        size_t thislen = server.repl_backlog_size - server.repl_backlog_idx;
        if (thislen > len) thislen = len;
        memcpy(server.repl_backlog+server.repl_backlog_idx,p,thislen);
        server.repl_backlog_idx += thislen;
        if (server.repl_backlog_idx == server.repl_backlog_size)
            server.repl_backlog_idx = 0;
        len -= thislen;
        p += thislen;
        server.repl_backlog_histlen += thislen;
    }
    if (server.repl_backlog_histlen > server.repl_backlog_size)
        server.repl_backlog_histlen = server.repl_backlog_size;
    /* Set the offset of the first byte we have in the backlog. */
    server.repl_backlog_off = server.master_repl_offset -
                              server.repl_backlog_histlen + 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0xbd83b(%rip), %r12     # 0x1018a8
addq %rsi, 0x7c0(%r12)
testq %rsi, %rsi
je 0x440f2
movq %rsi, %rbx
movq %rdi, %r14
movq 0x7d8(%r12), %r15
movq 0x7e8(%r12), %rdi
xorl %r13d, %r13d
subq %rdi, %r15
cmpq %rbx, %r15
cmovaeq %rbx, %r15
addq 0x7d0(%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x26c50
movq 0x7e8(%r12), %rdi
addq %r15, %rdi
movq 0x7d8(%r12), %rax
cmpq %rax, %rdi
cmoveq %r13, %rdi
movq %rdi, 0x7e8(%r12)
addq %r15, %r14
movq 0x7e0(%r12), %rcx
addq %r15, %rcx
movq %rcx, 0x7e0(%r12)
subq %r15, %rbx
movq %rax, %r15
jne 0x44093
jmp 0x44102
movq 0x7d8(%r12), %rax
movq 0x7e0(%r12), %rcx
cmpq %rax, %rcx
jle 0x44112
movq %rax, 0x7e0(%r12)
movq %rax, %rcx
movq 0x7c0(%r12), %rax
subq %rcx, %rax
incq %rax
movq %rax, 0x7f0(%r12)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: feedReplicationBacklogWithObject
void feedReplicationBacklogWithObject(robj *o) {
    char llstr[LONG_STR_SIZE];
    void *p;
    size_t len;

    if (o->encoding == OBJ_ENCODING_INT) {
        len = ll2string(llstr,sizeof(llstr),(long)o->ptr);
        p = llstr;
    } else {
        len = sdslen(o->ptr);
        p = o->ptr;
    }
    feedReplicationBacklog(p,len);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl $0xf0, %eax
andl (%rdi), %eax
movq 0x8(%rdi), %rdx
cmpl $0x10, %eax
jne 0x4416b
movq %rsp, %rbx
movl $0x15, %esi
movq %rbx, %rdi
callq 0x3ff83
movslq %eax, %rsi
movq %rbx, %rdx
movq %rdx, %rdi
callq 0x4405d
addq $0x20, %rsp
popq %rbx
retq
movzbl -0x1(%rdx), %esi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x441a5
leaq 0x7cf88(%rip), %rcx     # 0xc1108
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x4415d
movq -0x11(%rdx), %rsi
jmp 0x4415d
movzwl -0x5(%rdx), %esi
jmp 0x4415d
movl -0x9(%rdx), %esi
jmp 0x4415d
movzbl -0x3(%rdx), %esi
jmp 0x4415d
xorl %esi, %esi
jmp 0x4415d
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSetupSlaveForFullResync
int replicationSetupSlaveForFullResync(client *slave, long long offset) {
    char buf[128];
    int buflen;

    slave->psync_initial_offset = offset;
    slave->replstate = SLAVE_STATE_WAIT_BGSAVE_END;
    /* We are going to accumulate the incremental changes for this
     * slave as well. Set slaveseldb to -1 in order to force to re-emit
     * a SLEECT statement in the replication stream. */
    server.slaveseldb = -1;

    /* Don't send this reply to slaves that approached us with
     * the old SYNC command. */
    if (!(slave->flags & CLIENT_PRE_PSYNC)) {
        buflen = snprintf(buf,sizeof(buf),"+FULLRESYNC %s %lld\r\n",
                          server.runid,offset);
        if (write(slave->fd,buf,buflen) != buflen) {
            freeClientAsync(slave);
            return C_ERR;
        }
    }
    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, 0xe0(%rdi)
movl $0x7, 0xa0(%rdi)
leaq 0xbd0eb(%rip), %rcx     # 0x1018a8
movl $0xffffffff, 0x7bc(%rcx) # imm = 0xFFFFFFFF
xorl %ebp, %ebp
testb $0x1, 0x9a(%rdi)
jne 0x4481a
movq %rsi, %r8
movq %rdi, %rbx
addq $0x70, %rcx
leaq 0x7cc1d(%rip), %rdx     # 0xc1400
xorl %ebp, %ebp
movq %rsp, %r14
movl $0x80, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x26120
movl 0x8(%rbx), %edi
movslq %eax, %r15
movq %r14, %rsi
movq %r15, %rdx
callq 0x26bb0
cmpq %r15, %rax
je 0x4481a
movq %rbx, %rdi
callq 0x3db03
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: refreshGoodSlavesCount
void refreshGoodSlavesCount(void) {
    listIter li;
    listNode *ln;
    int good = 0;

    if (!server.repl_min_slaves_to_write ||
        !server.repl_min_slaves_max_lag) return;

    listRewind(server.slaves,&li);
    while((ln = listNext(&li))) {
        client *slave = ln->value;
        time_t lag = server.unixtime - slave->repl_ack_time;

        if (slave->replstate == SLAVE_STATE_ONLINE &&
            lag <= server.repl_min_slaves_max_lag) good++;
    }
    server.repl_good_slaves_count = good;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xbce6e(%rip), %r14     # 0x1018a8
cmpl $0x0, 0x808(%r14)
je 0x44ab2
cmpl $0x0, 0x80c(%r14)
je 0x44ab2
movq 0x1e0(%r14), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x2b3b7
movq %rbx, %rdi
callq 0x2b3d4
xorl %ebp, %ebp
testq %rax, %rax
je 0x44aab
movq %rsp, %rbx
movq 0x10(%rax), %rax
cmpl $0x9, 0xa0(%rax)
jne 0x44a9e
movq 0x978(%r14), %rcx
subq 0xd8(%rax), %rcx
movslq 0x80c(%r14), %rax
xorl %edx, %edx
cmpq %rax, %rcx
setle %dl
addl %edx, %ebp
movq %rbx, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x44a72
movl %ebp, 0x810(%r14)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: putSlaveOnline
void putSlaveOnline(client *slave) {
    slave->replstate = SLAVE_STATE_ONLINE;
    slave->repl_put_online_on_ack = 0;
    slave->repl_ack_time = server.unixtime; /* Prevent false timeout. */
    if (aeCreateFileEvent(server.el, slave->fd, AE_WRITABLE,
        sendReplyToClient, slave) == AE_ERR) {
        serverLog(LL_WARNING,"Unable to register writable event for slave bulk transfer: %s", strerror(errno));
        freeClient(slave);
        return;
    }
    refreshGoodSlavesCount();
    serverLog(LL_NOTICE,"Synchronization with slave %s succeeded",
        replicationGetSlaveName(slave));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x9, 0xa0(%rdi)
leaq 0xbc716(%rip), %rax     # 0x1018a8
movq 0x978(%rax), %rcx
movq %rcx, 0xd8(%rdi)
movq 0x40(%rax), %rdi
movl 0x8(%rbx), %esi
leaq -0x73a9(%rip), %rcx     # 0x3de05
movl $0x2, %edx
movq %rbx, %r8
callq 0x2ce46
cmpl $-0x1, %eax
je 0x451e8
callq 0x44a2b
movq %rbx, %rdi
callq 0x43e7c
leaq 0x7c6e9(%rip), %rsi     # 0xc18bd
leaq 0xd0f85(%rip), %rdx     # 0x116160
movl $0x2, %edi
xorl %eax, %eax
popq %rbx
jmp 0x2fdad
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x7c684(%rip), %rsi     # 0xc187f
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movq %rbx, %rdi
popq %rbx
jmp 0x3d73b
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSendAck
void replicationSendAck(void) {
    client *c = server.master;

    if (c != NULL) {
        c->flags |= CLIENT_MASTER_FORCE_REPLY;
        addReplyMultiBulkLen(c,3);
        addReplyBulkCString(c,"REPLCONF");
        addReplyBulkCString(c,"ACK");
        addReplyBulkLongLong(c,c->reploff);
        c->flags &= ~CLIENT_MASTER_FORCE_REPLY;
    }
}

// Assembly:
pushq %rbx
leaq 0xbc68d(%rip), %rax     # 0x1018a8
movq 0x838(%rax), %rbx
testq %rbx, %rbx
je 0x4526f
orb $0x20, 0x99(%rbx)
movl $0x3, %esi
movq %rbx, %rdi
callq 0x3d274
leaq 0x779a9(%rip), %rsi     # 0xbcbeb
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x779a6(%rip), %rsi     # 0xbcbf7
movq %rbx, %rdi
callq 0x3d0f2
movq 0xc8(%rbx), %rsi
movq %rbx, %rdi
callq 0x3d415
andb $-0x21, 0x99(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationSendNewlineToMaster
void replicationSendNewlineToMaster(void) {
    static time_t newline_sent;
    if (time(NULL) != newline_sent) {
        newline_sent = time(NULL);
        if (write(server.repl_transfer_s,"\n",1) == -1) {
            /* Pinging back in this stage is best-effort. */
        }
    }
}

// Assembly:
pushq %rax
xorl %edi, %edi
callq 0x26cd0
cmpq 0xd0af3(%rip), %rax     # 0x1161b0
jne 0x456c1
popq %rax
retq
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0xd0ae1(%rip)     # 0x1161b0
leaq 0xbc1d2(%rip), %rax     # 0x1018a8
movl 0x868(%rax), %edi
leaq 0x797e6(%rip), %rsi     # 0xbeec9
movl $0x1, %edx
popq %rax
jmp 0x26bb0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: replicationCreateMasterClient
void replicationCreateMasterClient(int fd) {
    server.master = createClient(fd);
    server.master->flags |= CLIENT_MASTER;
    server.master->authenticated = 1;
    server.repl_state = REPL_STATE_CONNECTED;
    server.master->reploff = server.repl_master_initial_offset;
    memcpy(server.master->replrunid, server.repl_master_runid,
        sizeof(server.repl_master_runid));
    /* If master offset is set to -1, this master is old and is not
     * PSYNC capable, so we flag it accordingly. */
    if (server.master->reploff == -1)
        server.master->flags |= CLIENT_PRE_PSYNC;
}

// Assembly:
pushq %rax
callq 0x3bdd4
leaq 0xbc1a8(%rip), %rcx     # 0x1018a8
movq %rax, 0x838(%rcx)
orb $0x2, 0x98(%rax)
movl $0x1, 0x9c(%rax)
movl $0xf, 0x84c(%rcx)
movq 0x8d8(%rcx), %rdx
movq %rdx, 0xc8(%rax)
movups 0x8a8(%rcx), %xmm0
movups 0x8b8(%rcx), %xmm1
movups 0x8c1(%rcx), %xmm2
movups %xmm2, 0x101(%rax)
movups %xmm1, 0xf8(%rax)
movups %xmm0, 0xe8(%rax)
movq 0x838(%rcx), %rax
cmpq $-0x1, 0xc8(%rax)
jne 0x45772
orb $0x1, 0x9a(%rax)
popq %rax
retq