LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/cluster.c
// Function: clusterRedirectBlockedClientIfNeeded
int clusterRedirectBlockedClientIfNeeded(client *c) {
    if (c->flags & CLIENT_BLOCKED && c->btype == BLOCKED_LIST) {
        dictEntry *de;
        dictIterator *di;

        /* If the cluster is down, unblock the client with the right error. */
        if (server.cluster->state == CLUSTER_FAIL) {
            clusterRedirectClient(c,NULL,0,CLUSTER_REDIR_DOWN_STATE);
            return 1;
        }

        /* All keys must belong to the same slot, so check first key only. */
        di = dictGetIterator(c->bpop.keys);
        if ((de = dictNext(di)) != NULL) {
            robj *key = dictGetKey(de);
            int slot = keyHashSlot((char*)key->ptr, sdslen(key->ptr));
            clusterNode *node = server.cluster->slots[slot];

            /* We send an error and unblock the client if:
             * 1) The slot is unassigned, emitting a cluster down error.
             * 2) The slot is not handled by this node, nor being imported. */
            if (node != myself &&
                server.cluster->importing_slots_from[slot] == NULL)
            {
                if (node == NULL) {
                    clusterRedirectClient(c,NULL,0,
                        CLUSTER_REDIR_DOWN_UNBOUND);
                } else {
                    clusterRedirectClient(c,node,slot,
                        CLUSTER_REDIR_MOVED);
                }
                dictReleaseIterator(di);
                return 1;
            }
        }
        dictReleaseIterator(di);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebp, %ebp
testb $0x10, 0x98(%rdi)
je 0x6d0a6
movq %rdi, %rbx
cmpl $0x1, 0x168(%rdi)
jne 0x6d0a6
leaq 0x948c1(%rip), %r15     # 0x1018a8
movq 0x9b0(%r15), %rax
cmpl $0x1, 0x10(%rax)
jne 0x6d015
leaq 0x5c350(%rip), %rdi     # 0xc934b
callq 0x362b0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3ca86
movl $0x1, %ebp
jmp 0x6d0a6
movq 0x178(%rbx), %rdi
callq 0x2efbb
movq %rax, %r14
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x6d09e
movq (%rax), %rax
movq 0x8(%rax), %rdi
movzbl -0x1(%rdi), %esi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6d072
leaq 0x5a5d3(%rip), %rcx     # 0xc7620
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x6d074
movq -0x11(%rdi), %rsi
jmp 0x6d074
movzwl -0x5(%rdi), %esi
jmp 0x6d074
movl -0x9(%rdi), %esi
jmp 0x6d074
movzbl -0x3(%rdi), %esi
jmp 0x6d074
xorl %esi, %esi
callq 0x66701
movq 0x9b0(%r15), %rcx
movl %eax, %edx
movq 0x40028(%rcx,%rdx,8), %rsi
cmpq 0xa919f(%rip), %rsi     # 0x116230
je 0x6d09e
cmpq $0x0, 0x20028(%rcx,%rdx,8)
je 0x6d0b3
movq %r14, %rdi
callq 0x2f0dd
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testq %rsi, %rsi
je 0x6d0c7
movq %rbx, %rdi
movl $0x4, %ecx
callq 0x6cee7
jmp 0x6d0de
leaq 0x5c2a0(%rip), %rdi     # 0xc936e
callq 0x362b0
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3ca86
movq %r14, %rdi
callq 0x2f0dd
jmp 0x6d00b
nop
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/crc16.c
// Function: crc16
uint16_t crc16(const char *buf, int len) {
    int counter;
    uint16_t crc = 0;
    for (counter = 0; counter < len; counter++)
            crc = (crc<<8) ^ crc16tab[((crc>>8) ^ *buf++)&0x00FF];
    return crc;
}

// Assembly:
testl %esi, %esi
jle 0x6d124
movl %esi, %ecx
xorl %edx, %edx
leaq 0x5c315(%rip), %rsi     # 0xc9410
xorl %r8d, %r8d
movl %r8d, %eax
shll $0x8, %eax
movzwl %r8w, %r8d
shrl $0x8, %r8d
movzbl (%rdi,%rdx), %r9d
xorl %r8d, %r9d
xorw (%rsi,%r9,2), %ax
incq %rdx
movl %eax, %r8d
cmpl %edx, %ecx
jne 0x6d0fe
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/slowlog.c
// Function: slowlogFreeEntry
void slowlogFreeEntry(void *septr) {
    slowlogEntry *se = septr;
    int j;

    for (j = 0; j < se->argc; j++)
        decrRefCount(se->argv[j]);
    zfree(se->argv);
    zfree(se);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x6d377
xorl %r14d, %r14d
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x40c8f
incq %r14
movslq 0x8(%rbx), %rax
cmpq %rax, %r14
jl 0x6d35f
movq (%rbx), %rdi
callq 0x38413
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38413
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/slowlog.c
// Function: slowlogPushEntryIfNeeded
void slowlogPushEntryIfNeeded(robj **argv, int argc, long long duration) {
    if (server.slowlog_log_slower_than < 0) return; /* Slowlog disabled */
    if (duration >= server.slowlog_log_slower_than)
        listAddNodeHead(server.slowlog,slowlogCreateEntry(argv,argc,duration));

    /* Remove old entries if needed. */
    while (listLength(server.slowlog) > server.slowlog_max_len)
        listDelNode(server.slowlog,listLast(server.slowlog));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x944e3(%rip), %r14     # 0x1018a8
movq 0x408(%r14), %rax
testq %rax, %rax
js 0x6d40c
cmpq %rdx, %rax
jg 0x6d3f8
movq 0x3f8(%r14), %rbx
callq 0x6d180
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2b1ec
jmp 0x6d3f8
movq 0x8(%rdi), %rsi
callq 0x2b331
movq 0x3f8(%r14), %rdi
movq 0x28(%rdi), %rax
cmpq 0x410(%r14), %rax
ja 0x6d3ef
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: sha1hex
void sha1hex(char *digest, char *script, size_t len) {
    SHA1_CTX ctx;
    unsigned char hash[20];
    char *cset = "0123456789abcdef";
    int j;

    SHA1Init(&ctx);
    SHA1Update(&ctx,(unsigned char*)script,len);
    SHA1Final(hash,&ctx);

    for (j = 0; j < 20; j++) {
        digest[j*2] = cset[((hash[j]&0xF0)>>4)];
        digest[j*2+1] = cset[(hash[j]&0xF)];
    }
    digest[40] = '\0';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1c(%rsp), %r12
movq %r12, %rdi
callq 0x3a7ed
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x3a808
movq %rsp, %rdi
movq %r12, %rsi
callq 0x3a8c4
xorl %eax, %eax
leaq 0x5343c(%rip), %rcx     # 0xc0a93
movzbl (%rsp,%rax), %edx
movl %edx, %esi
shrl $0x4, %esi
movb (%rsi,%rcx), %sil
movb %sil, (%rbx,%rax,2)
andl $0xf, %edx
movb (%rdx,%rcx), %dl
movb %dl, 0x1(%rbx,%rax,2)
incq %rax
cmpq $0x14, %rax
jne 0x6d657
movb $0x0, 0x28(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType
char *redisProtocolToLuaType(lua_State *lua, char* reply) {
    char *p = reply;

    switch(*p) {
    case ':': p = redisProtocolToLuaType_Int(lua,reply); break;
    case '$': p = redisProtocolToLuaType_Bulk(lua,reply); break;
    case '+': p = redisProtocolToLuaType_Status(lua,reply); break;
    case '-': p = redisProtocolToLuaType_Error(lua,reply); break;
    case '*': p = redisProtocolToLuaType_MultiBulk(lua,reply); break;
    }
    return p;
}

// Assembly:
movzbl (%rsi), %ecx
leal -0x24(%rcx), %eax
cmpl $0x9, %eax
ja 0x6d6ab
leaq 0x5c00b(%rip), %rcx     # 0xc96a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x6d72b
cmpl $0x3a, %ecx
jne 0x6d6b5
jmp 0x6d6c8
movq %rsi, %rax
retq
jmp 0x6d7aa
jmp 0x6d81b
jmp 0x6d88c
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Int
char *redisProtocolToLuaType_Int(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long value;

    string2ll(reply+1,p-reply-1,&value);
    lua_pushnumber(lua,(lua_Number)value);
    return p+2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %r15
movq %r15, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, %r12
notq %rbx
addq %rax, %rbx
leaq 0x8(%rsp), %r13
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x40065
cvtsi2sdq (%r13), %xmm0
movq %r14, %rdi
callq 0x8649b
addq $0x2, %r12
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Bulk
char *redisProtocolToLuaType_Bulk(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long bulklen;

    string2ll(reply+1,p-reply-1,&bulklen);
    if (bulklen == -1) {
        lua_pushboolean(lua,0);
        return p+2;
    } else {
        lua_pushlstring(lua,p+2,bulklen);
        return p+2+bulklen+2;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x1(%rsi), %r12
movq %r12, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, %rbx
notq %r15
addq %rax, %r15
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x40065
movq (%r13), %rdx
cmpq $-0x1, %rdx
je 0x6d78b
addq $0x2, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x864ca
addq 0x8(%rsp), %rbx
jmp 0x6d795
movq %r14, %rdi
xorl %esi, %esi
callq 0x866ed
addq $0x2, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Status
char *redisProtocolToLuaType_Status(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');

    lua_newtable(lua);
    lua_pushstring(lua,"ok");
    lua_pushlstring(lua,reply+1,p-reply-1);
    lua_settable(lua,-3);
    return p+2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1(%rsi), %r12
movq %r12, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x86818
leaq 0x639f8(%rip), %rsi     # 0xd11d7
movq %rbx, %rdi
callq 0x86521
notq %r15
addq %r14, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x864ca
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x86914
addq $0x2, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_Error
char *redisProtocolToLuaType_Error(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');

    lua_newtable(lua);
    lua_pushstring(lua,"err");
    lua_pushlstring(lua,reply+1,p-reply-1);
    lua_settable(lua,-3);
    return p+2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1(%rsi), %r12
movq %r12, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x86818
leaq 0x50648(%rip), %rsi     # 0xbde98
movq %rbx, %rdi
callq 0x86521
notq %r15
addq %r14, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x864ca
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x86914
addq $0x2, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redisProtocolToLuaType_MultiBulk
char *redisProtocolToLuaType_MultiBulk(lua_State *lua, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long mbulklen;
    int j = 0;

    string2ll(reply+1,p-reply-1,&mbulklen);
    p += 2;
    if (mbulklen == -1) {
        lua_pushboolean(lua,0);
        return p;
    }
    lua_newtable(lua);
    for (j = 0; j < mbulklen; j++) {
        lua_pushnumber(lua,j+1);
        p = redisProtocolToLuaType(lua,p);
        lua_settable(lua,-3);
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x1(%rsi), %r12
movq %r12, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, %rbx
notq %r15
addq %rax, %r15
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x40065
addq $0x2, %rbx
cmpq $-0x1, (%r13)
je 0x6d925
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x86818
cmpq $0x0, 0x8(%rsp)
jle 0x6d92f
xorl %r15d, %r15d
incq %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movq %r14, %rdi
callq 0x8649b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6d68b
movq %rax, %rbx
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x86914
cmpq %r15, 0x8(%rsp)
jg 0x6d8ee
jmp 0x6d92f
movq %r14, %rdi
xorl %esi, %esi
callq 0x866ed
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaPushError
void luaPushError(lua_State *lua, char *error) {
    lua_Debug dbg;

    /* If debugging is active and in step mode, log errors resulting from
     * Redis commands. */
    if (ldb.active && ldb.step) {
        ldbLog(sdscatprintf(sdsempty(),"<error> %s",error));
    }

    lua_newtable(lua);
    lua_pushstring(lua,"err");

    /* Attempt to figure out where this function was called, if possible */
    if(lua_getstack(lua, 1, &dbg) && lua_getinfo(lua, "nSl", &dbg)) {
        sds msg = sdscatprintf(sdsempty(), "%s: %d: %s",
            dbg.source, dbg.currentline, error);
        lua_pushstring(lua, msg);
        sdsfree(msg);
    } else {
        lua_pushstring(lua, error);
    }
    lua_settable(lua,-3);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0xa8910(%rip)     # 0x116264
je 0x6d987
cmpl $0x0, 0xa8a2f(%rip)     # 0x11638c
je 0x6d987
callq 0x3628d
leaq 0x5bfd5(%rip), %rsi     # 0xc9940
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x36f2d
movq 0xa88f1(%rip), %rdi     # 0x116270
movq %rax, %rsi
callq 0x2b24b
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x86818
leaq 0x504fe(%rip), %rsi     # 0xbde98
movq %rbx, %rdi
callq 0x86521
movq %rsp, %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x870c1
testl %eax, %eax
je 0x6da06
leaq 0x5bf8e(%rip), %rsi     # 0xc994b
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x8723a
testl %eax, %eax
je 0x6da06
callq 0x3628d
movq 0x20(%rsp), %rdx
movl 0x28(%rsp), %ecx
leaq 0x5bf6e(%rip), %rsi     # 0xc994f
movq %rax, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x36f2d
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x86521
movq %r14, %rdi
callq 0x36330
jmp 0x6da11
movq %rbx, %rdi
movq %r14, %rsi
callq 0x86521
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x86914
addq $0x78, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaSortArray
void luaSortArray(lua_State *lua) {
    /* Initial Stack: array */
    lua_getglobal(lua,"table");
    lua_pushstring(lua,"sort");
    lua_gettable(lua,-2);       /* Stack: array, table, table.sort */
    lua_pushvalue(lua,-3);      /* Stack: array, table, table.sort, array */
    if (lua_pcall(lua,1,0,0)) {
        /* Stack: array, table, error */

        /* We are not interested in the error, we assume that the problem is
         * that there are 'false' elements inside the array, so we try
         * again with a slower function but able to handle this case, that
         * is: table.sort(table, __redis__compare_helper) */
        lua_pop(lua,1);             /* Stack: array, table */
        lua_pushstring(lua,"sort"); /* Stack: array, table, sort */
        lua_gettable(lua,-2);       /* Stack: array, table, table.sort */
        lua_pushvalue(lua,-3);      /* Stack: array, table, table.sort, array */
        lua_getglobal(lua,"__redis__compare_helper");
        /* Stack: array, table, table.sort, array, __redis__compare_helper */
        lua_call(lua,2,0);
    }
    /* Stack: array (sorted), table */
    lua_pop(lua,1);             /* Stack: array (sorted) */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x4e92a(%rip), %rdx     # 0xbc390
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x8675f
leaq 0x4ee12(%rip), %rsi     # 0xbc889
movq %rbx, %rdi
callq 0x86521
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x8673f
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x8609a
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x86bad
testl %eax, %eax
je 0x6db07
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x85d59
leaq 0x4edc7(%rip), %rsi     # 0xbc889
movq %rbx, %rdi
callq 0x86521
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x8673f
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x8609a
leaq 0x5be6f(%rip), %rdx     # 0xc995a
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x8675f
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x86b75
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
popq %rbx
jmp 0x85d59
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRedisSha1hexCommand
int luaRedisSha1hexCommand(lua_State *lua) {
    int argc = lua_gettop(lua);
    char digest[41];
    size_t len;
    char *s;

    if (argc != 1) {
        lua_pushstring(lua, "wrong number of arguments");
        return lua_error(lua);
    }

    s = (char*)lua_tolstring(lua,1,&len);
    sha1hex(digest,s,len);
    lua_pushstring(lua,digest);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
callq 0x85d4c
cmpl $0x1, %eax
jne 0x6e73a
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x862f8
movq (%r14), %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x6d614
movq %rbx, %rdi
movq %r14, %rsi
callq 0x86521
movl $0x1, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
leaq 0x56222(%rip), %rsi     # 0xc4963
movq %rbx, %rdi
callq 0x86521
movq %rbx, %rdi
addq $0x48, %rsp
popq %rbx
popq %r14
jmp 0x86e29
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRedisReturnSingleFieldTable
int luaRedisReturnSingleFieldTable(lua_State *lua, char *field) {
    if (lua_gettop(lua) != 1 || lua_type(lua,-1) != LUA_TSTRING) {
        luaPushError(lua, "wrong number or type of arguments");
        return 1;
    }

    lua_newtable(lua);
    lua_pushstring(lua, field);
    lua_pushvalue(lua, -3);
    lua_settable(lua, -3);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x85d4c
cmpl $0x1, %eax
jne 0x6e7b1
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x860ba
cmpl $0x4, %eax
jne 0x6e7b1
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x86818
movq %rbx, %rdi
movq %r14, %rsi
callq 0x86521
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x8609a
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x86914
jmp 0x6e7c0
leaq 0x5b438(%rip), %rsi     # 0xc9bf0
movq %rbx, %rdi
callq 0x6d940
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRedisReplicateCommandsCommand
int luaRedisReplicateCommandsCommand(lua_State *lua) {
    if (server.lua_write_dirty) {
        lua_pushboolean(lua,0);
    } else {
        server.lua_replicate_commands = 1;
        /* When we switch to single commands replication, we can provide
         * different math.random() sequences at every call, which is what
         * the user normally expects. */
        redisSrand48(rand());
        lua_pushboolean(lua,1);
    }
    return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x930a8(%rip), %rax     # 0x1018a8
xorl %esi, %esi
cmpl $0x0, 0x9f8(%rax)
jne 0x6e826
movl $0x1, 0xa00(%rax)
callq 0x26b70
movl %eax, %edi
callq 0x72dcf
movl $0x1, %esi
movq %rbx, %rdi
callq 0x866ed
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRedisDebugCommand
int luaRedisDebugCommand(lua_State *lua) {
    if (!ldb.active) return 0;
    int argc = lua_gettop(lua);
    sds log = sdscatprintf(sdsempty(),"<debug> line %d: ", ldb.currentline);
    while(argc--) {
        log = ldbCatStackValue(log,lua,-1 - argc);
        if (argc != 0) log = sdscatlen(log,", ",2);
    }
    ldbLog(log);
    return 0;
}

// Assembly:
cmpl $0x0, 0xa79ff(%rip)     # 0x116264
je 0x6e900
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x85d4c
movl %eax, %ebp
callq 0x3628d
movl 0xa7b1d(%rip), %edx     # 0x1163a4
leaq 0x5b384(%rip), %rsi     # 0xc9c12
movq %rax, %rdi
xorl %eax, %eax
callq 0x36f2d
testl %ebp, %ebp
je 0x6e8e7
movl %ebp, %edx
negl %edx
movq %rax, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x70c79
cmpl $0x1, %ebp
je 0x6e8e7
movl $0x1, %r14d
subl %ebp, %r14d
leaq 0x5b362(%rip), %r15     # 0xc9c24
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x36ad1
movq %rax, %rdi
movq %rbx, %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x70c79
incl %r14d
jne 0x6e8c2
movq 0xa7982(%rip), %rdi     # 0x116270
movq %rax, %rsi
callq 0x2b24b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRedisSetReplCommand
int luaRedisSetReplCommand(lua_State *lua) {
    int argc = lua_gettop(lua);
    int flags;

    if (server.lua_replicate_commands == 0) {
        lua_pushstring(lua, "You can set the replication behavior only after turning on single commands replication with redis.replicate_commands().");
        return lua_error(lua);
    } else if (argc != 1) {
        lua_pushstring(lua, "redis.set_repl() requires two arguments.");
        return lua_error(lua);
    }

    flags = lua_tonumber(lua,-1);
    if ((flags & ~(PROPAGATE_AOF|PROPAGATE_REPL)) != 0) {
        lua_pushstring(lua, "Invalid replication flags. Use REPL_AOF, REPL_SLAVE, REPL_ALL or REPL_NONE.");
        return lua_error(lua);
    }
    server.lua_repl = flags;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x85d4c
leaq 0x92f8b(%rip), %r14     # 0x1018a8
cmpl $0x0, 0xa00(%r14)
je 0x6e953
cmpl $0x1, %eax
jne 0x6e95c
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x86274
cvttsd2si %xmm0, %eax
cmpl $0x4, %eax
jae 0x6e965
movl %eax, 0xa08(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5b2cd(%rip), %rsi     # 0xc9c27
jmp 0x6e96c
leaq 0x5b33c(%rip), %rsi     # 0xc9c9f
jmp 0x6e96c
leaq 0x5b35c(%rip), %rsi     # 0xc9cc8
movq %rbx, %rdi
callq 0x86521
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x86e29
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaLogCommand
int luaLogCommand(lua_State *lua) {
    int j, argc = lua_gettop(lua);
    int level;
    sds log;

    if (argc < 2) {
        lua_pushstring(lua, "redis.log() requires two arguments or more.");
        return lua_error(lua);
    } else if (!lua_isnumber(lua,-argc)) {
        lua_pushstring(lua, "First argument must be a number (log level).");
        return lua_error(lua);
    }
    level = lua_tonumber(lua,-argc);
    if (level < LL_DEBUG || level > LL_WARNING) {
        lua_pushstring(lua, "Invalid debug level.");
        return lua_error(lua);
    }

    /* Glue together all the arguments */
    log = sdsempty();
    for (j = 1; j < argc; j++) {
        size_t len;
        char *s;

        s = (char*)lua_tolstring(lua,(-argc)+j,&len);
        if (s) {
            if (j != 1) log = sdscatlen(log," ",1);
            log = sdscatlen(log,s,len);
        }
    }
    serverLogRaw(level,log);
    sdsfree(log);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x85d4c
cmpl $0x1, %eax
jg 0x6e9a7
leaq 0x5b36f(%rip), %rsi     # 0xc9d14
jmp 0x6e9df
movl %eax, %r15d
movl %eax, %ebp
negl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x86113
testl %eax, %eax
je 0x6e9d8
movq %rbx, %rdi
movl %ebp, %esi
callq 0x86274
cvttsd2si %xmm0, %eax
cmpl $0x4, %eax
jb 0x6e9fd
leaq 0x5b397(%rip), %rsi     # 0xc9d6d
jmp 0x6e9df
leaq 0x5b361(%rip), %rsi     # 0xc9d40
movq %rbx, %rdi
callq 0x86521
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x86e29
movl %eax, 0xc(%rsp)
callq 0x3628d
movq %rax, %r14
movl $0x1, %ebp
subl %r15d, %ebp
xorl %r12d, %r12d
leaq 0x10(%rsp), %r15
leal (%r12,%rbp), %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x862f8
testq %rax, %rax
je 0x6ea5f
movq %rax, %r13
testl %r12d, %r12d
je 0x6ea4c
movl $0x1, %edx
movq %r14, %rdi
leaq 0x56259(%rip), %rsi     # 0xc4c9d
callq 0x36ad1
movq %rax, %r14
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x36ad1
movq %rax, %r14
incl %r12d
movl %ebp, %eax
addl %r12d, %eax
jne 0x6ea19
movl 0xc(%rsp), %edi
movq %r14, %rsi
callq 0x2fc13
movq %r14, %rdi
callq 0x36330
xorl %eax, %eax
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/scripting.c
// Function: luaLoadLibraries
void luaLoadLibraries(lua_State *lua) {
    luaLoadLib(lua, "", luaopen_base);
    luaLoadLib(lua, LUA_TABLIBNAME, luaopen_table);
    luaLoadLib(lua, LUA_STRLIBNAME, luaopen_string);
    luaLoadLib(lua, LUA_MATHLIBNAME, luaopen_math);
    luaLoadLib(lua, LUA_DBLIBNAME, luaopen_debug);
    luaLoadLib(lua, "cjson", luaopen_cjson);
    luaLoadLib(lua, "struct", luaopen_struct);
    luaLoadLib(lua, "cmsgpack", luaopen_cmsgpack);
    luaLoadLib(lua, "bit", luaopen_bit);

#if 0 /* Stuff that we don't load currently, for sandboxing concerns. */
    luaLoadLib(lua, LUA_LOADLIBNAME, luaopen_package);
    luaLoadLib(lua, LUA_OSLIBNAME, luaopen_os);
#endif
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x51fe7(%rip), %rsi     # 0xc0ab5
leaq 0x23637(%rip), %rdx     # 0x9210c
callq 0x6ea8e
leaq 0x4d8af(%rip), %rsi     # 0xbc390
leaq 0x25d54(%rip), %rdx     # 0x9483c
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x624b8(%rip), %rsi     # 0xd0faf
leaq 0x2672e(%rip), %rdx     # 0x9522c
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x5b275(%rip), %rsi     # 0xc9d82
leaq 0x25624(%rip), %rdx     # 0x94138
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x64d12(%rip), %rsi     # 0xd3835
leaq 0x24976(%rip), %rdx     # 0x934a0
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x5b24e(%rip), %rsi     # 0xc9d87
leaq 0x28244(%rip), %rdx     # 0x96d84
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x5b23e(%rip), %rsi     # 0xc9d8d
leaq 0x29be6(%rip), %rdx     # 0x9873c
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x5b22f(%rip), %rsi     # 0xc9d94
leaq 0x2b95f(%rip), %rdx     # 0x9a4cb
movq %rbx, %rdi
callq 0x6ea8e
leaq 0x635f7(%rip), %rsi     # 0xd2172
leaq 0x2ba0a(%rip), %rdx     # 0x9a58c
movq %rbx, %rdi
popq %rbx
jmp 0x6ea8e
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRemoveUnsupportedFunctions
void luaRemoveUnsupportedFunctions(lua_State *lua) {
    lua_pushnil(lua);
    lua_setglobal(lua,"loadfile");
    lua_pushnil(lua);
    lua_setglobal(lua,"dofile");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x86487
leaq 0x5b202(%rip), %rdx     # 0xc9d9d
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x8693b
movq %rbx, %rdi
callq 0x86487
leaq 0x5b1ef(%rip), %rdx     # 0xc9da6
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
popq %rbx
jmp 0x8693b
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbInit
void ldbInit(void) {
    ldb.fd = -1;
    ldb.active = 0;
    ldb.logs = listCreate();
    listSetFreeMethod(ldb.logs,(void (*)(void*))sdsfree);
    ldb.children = listCreate();
    ldb.src = NULL;
    ldb.lines = 0;
    ldb.cbuf = sdsempty();
}

// Assembly:
pushq %rax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0xa7041(%rip)     # 0x116260
callq 0x2b17c
movq %rax, 0xa7045(%rip)     # 0x116270
leaq -0x38f02(%rip), %rcx    # 0x36330
movq %rcx, 0x18(%rax)
callq 0x2b17c
movq %rax, 0xa703e(%rip)     # 0x116280
movq $0x0, 0xa714b(%rip) # 0x116398
movl $0x0, 0xa7149(%rip)     # 0x1163a0
callq 0x3628d
movq %rax, 0xa7145(%rip)     # 0x1163a8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: redis_math_random
int redis_math_random (lua_State *L) {
  /* the `%' avoids the (rare) case of r==1, and is needed also because on
     some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */
  lua_Number r = (lua_Number)(redisLrand48()%REDIS_LRAND48_MAX) /
                                (lua_Number)REDIS_LRAND48_MAX;
  switch (lua_gettop(L)) {  /* check number of arguments */
    case 0: {  /* no arguments */
      lua_pushnumber(L, r);  /* Number between 0 and 1 */
      break;
    }
    case 1: {  /* only upper limit */
      int u = luaL_checkint(L, 1);
      luaL_argcheck(L, 1<=u, 1, "interval is empty");
      lua_pushnumber(L, floor(r*u)+1);  /* int between 1 and `u' */
      break;
    }
    case 2: {  /* lower and upper limits */
      int l = luaL_checkint(L, 1);
      int u = luaL_checkint(L, 2);
      luaL_argcheck(L, l<=u, 2, "interval is empty");
      lua_pushnumber(L, floor(r*(u-l+1))+l);  /* int between `l' and `u' */
      break;
    }
    default: return luaL_error(L, "wrong number of arguments");
  }
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %eax, %eax
callq 0x72d08
cltq
movq %rax, %rcx
shlq $0x1e, %rcx
addq %rax, %rcx
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x3d, %rcx
addl %edx, %ecx
addl %ecx, %eax
shll $0x1f, %ecx
addl %eax, %ecx
cvtsi2sd %ecx, %xmm0
divsd 0x5a694(%rip), %xmm0    # 0xc9938
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x85d4c
cmpl $0x2, %eax
je 0x6f319
cmpl $0x1, %eax
je 0x6f2d2
testl %eax, %eax
jne 0x6f38c
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
jmp 0x6f378
movq %rbx, %rdi
movl $0x1, %esi
callq 0x915e4
movq %rax, %r14
testl %r14d, %r14d
jg 0x6f2fb
leaq 0x5af1b(%rip), %rdx     # 0xca209
movq %rbx, %rdi
movl $0x1, %esi
callq 0x91090
cvtsi2sd %r14d, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x26b50
addsd 0x51709(%rip), %xmm0    # 0xc0a20
jmp 0x6f375
movq %rbx, %rdi
movl $0x1, %esi
callq 0x915e4
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x915e4
movq %rax, %r15
subl %r14d, %r15d
jge 0x6f352
leaq 0x5aec4(%rip), %rdx     # 0xca209
movq %rbx, %rdi
movl $0x2, %esi
callq 0x91090
incl %r15d
cvtsi2sd %r15d, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x26b50
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
addsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x8649b
movl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x555d0(%rip), %rsi     # 0xc4963
movq %rbx, %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x91147
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaSetGlobalArray
void luaSetGlobalArray(lua_State *lua, char *var, robj **elev, int elec) {
    int j;

    lua_newtable(lua);
    for (j = 0; j < elec; j++) {
        lua_pushlstring(lua,(char*)elev[j]->ptr,sdslen(elev[j]->ptr));
        lua_rawseti(lua,-2,j+1);
    }
    lua_setglobal(lua,var);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %esi, %esi
xorl %edx, %edx
callq 0x86818
testl %ebp, %ebp
jle 0x6f493
movl %ebp, %r13d
xorl %r12d, %r12d
leaq 0x5a30f(%rip), %rbp     # 0xc9744
movq (%r14,%r12,8), %rax
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6f471
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x6f473
movq -0x11(%rsi), %rdx
jmp 0x6f473
movzwl -0x5(%rsi), %edx
jmp 0x6f473
movl -0x9(%rsi), %edx
jmp 0x6f473
movzbl -0x3(%rsi), %edx
jmp 0x6f473
xorl %edx, %edx
movq %r15, %rdi
callq 0x864ca
incq %r12
movq %r15, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl %r12d, %edx
callq 0x869ff
cmpq %r12, %r13
jne 0x6f435
movq %r15, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8693b
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaMaskCountHook
void luaMaskCountHook(lua_State *lua, lua_Debug *ar) {
    long long elapsed;
    UNUSED(ar);
    UNUSED(lua);

    elapsed = mstime() - server.lua_time_start;
    if (elapsed >= server.lua_time_limit && server.lua_timedout == 0) {
        serverLog(LL_WARNING,"Lua slow script detected: still in execution after %lld milliseconds. You can try killing the script using the SCRIPT KILL command.",elapsed);
        server.lua_timedout = 1;
        /* Once the script timeouts we reenter the event loop to permit others
         * to call SCRIPT KILL or SHUTDOWN NOSAVE if needed. For this reason
         * we need to mask the client executing the script from the event loop.
         * If we don't do that the client may disconnect and could no longer be
         * here when the EVAL command will return. */
         aeDeleteFileEvent(server.el, server.lua_caller->fd, AE_READABLE);
    }
    if (server.lua_timedout) processEventsWhileBlocked();
    if (server.lua_kill) {
        serverLog(LL_WARNING,"Lua script killed by user with SCRIPT KILL.");
        lua_pushstring(lua,"Script killed by user with SCRIPT KILL...");
        lua_error(lua);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2ffce
leaq 0x921da(%rip), %r14     # 0x1018a8
subq 0x9f0(%r14), %rax
cmpq 0x9e8(%r14), %rax
setge %dl
movl 0xa0c(%r14), %ecx
testl %ecx, %ecx
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x6f735
leaq 0x5ab9f(%rip), %rsi     # 0xca29b
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movl $0x1, 0xa0c(%r14)
movq 0x40(%r14), %rdi
movq 0x9d8(%r14), %rax
movl 0x8(%rax), %esi
movl $0x1, %edx
callq 0x2cf0e
movl 0xa0c(%r14), %ecx
testl %ecx, %ecx
je 0x6f73e
callq 0x3f9e8
cmpl $0x0, 0xa10(%r14)
je 0x6f779
leaq 0x5abd0(%rip), %rsi     # 0xca31f
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
leaq 0x5abe9(%rip), %rsi     # 0xca34b
movq %rbx, %rdi
callq 0x86521
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x86e29
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: evalGenericCommandWithDebugging
void evalGenericCommandWithDebugging(client *c, int evalsha) {
    if (ldbStartSession(c)) {
        evalGenericCommand(c,evalsha);
        ldbEndSession(c);
    } else {
        ldbDisable(c);
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x70532
testl %eax, %eax
je 0x6feb1
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6f781
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x707a9
andb $-0x7, 0x9b(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: evalShaCommand
void evalShaCommand(client *c) {
    if (sdslen(c->argv[1]->ptr) != 40) {
        /* We know that a match is not possible if the provided SHA is
         * not the right length. So we return an error ASAP, this way
         * evalGenericCommand() can be implemented without string length
         * sanity check */
        addReply(c, shared.noscripterr);
        return;
    }
    if (!(c->flags & CLIENT_LUA_DEBUG))
        evalGenericCommand(c,1);
    else {
        addReplyError(c,"Please use EVAL instead of EVALSHA for debugging");
        return;
    }
}

// Assembly:
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movzbl -0x1(%rax), %ecx
andl $0x7, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x6ff17
leaq 0x598b4(%rip), %rdx     # 0xc9794
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzbl -0x3(%rax), %eax
jmp 0x6fefe
movl -0x9(%rax), %eax
jmp 0x6fefe
movq -0x11(%rax), %rax
jmp 0x6fefe
movzwl -0x5(%rax), %eax
cmpq $0x28, %rax
jne 0x6ff17
testb $0x2, 0x9b(%rdi)
jne 0x6ff2a
movl $0x1, %esi
jmp 0x6f781
leaq 0x923f2(%rip), %rax     # 0x102310
movq 0x98(%rax), %rsi
jmp 0x3c854
leaq 0x5a50c(%rip), %rsi     # 0xca43d
jmp 0x3cc06
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbEnable
void ldbEnable(client *c) {
    c->flags |= CLIENT_LUA_DEBUG;
    ldbFlushLog(ldb.logs);
    ldb.fd = c->fd;
    ldb.step = 1;
    ldb.bpcount = 0;
    ldb.luabp = 0;
    sdsfree(ldb.cbuf);
    ldb.cbuf = sdsempty();
    ldb.maxlen = LDB_MAX_LEN_DEFAULT;
    ldb.maxlen_hint_sent = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
orb $0x2, 0x9b(%rdi)
movq 0xa5f99(%rip), %r14     # 0x116270
movq (%r14), %rsi
testq %rsi, %rsi
je 0x702e9
movq %r14, %rdi
callq 0x2b331
jmp 0x702d7
movl 0x8(%rbx), %eax
movl %eax, 0xa5f6e(%rip)     # 0x116260
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0xa6085(%rip)     # 0x116388
xorl %ebx, %ebx
movl %ebx, 0xa6085(%rip)     # 0x116390
movq 0xa6096(%rip), %rdi     # 0x1163a8
callq 0x36330
callq 0x3628d
movq %rax, 0xa6085(%rip)     # 0x1163a8
movq $0x100, 0xa6082(%rip) # imm = 0x100
movl %ebx, 0xa6084(%rip)     # 0x1163b8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbLogWithMaxLen
void ldbLogWithMaxLen(sds entry) {
    int trimmed = 0;
    if (ldb.maxlen && sdslen(entry) > ldb.maxlen) {
        sdsrange(entry,0,ldb.maxlen-1);
        entry = sdscatlen(entry," ...",4);
        trimmed = 1;
    }
    ldbLog(entry);
    if (trimmed && ldb.maxlen_hint_sent == 0) {
        ldb.maxlen_hint_sent = 1;
        ldbLog(sdsnew(
        "<hint> The above reply was trimmed. Use 'maxlen 0' to disable trimming."));
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xa6049(%rip), %rdx     # 0x1163b0
testq %rdx, %rdx
je 0x703d1
movzbl -0x1(%rbx), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x703d1
leaq 0x59437(%rip), %rsi     # 0xc97b8
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x703a4
movq -0x11(%rbx), %rax
jmp 0x703a4
movzwl -0x5(%rbx), %eax
jmp 0x703a4
movl -0x9(%rbx), %eax
jmp 0x703a4
movzbl -0x3(%rbx), %eax
cmpq %rdx, %rax
jbe 0x703d1
decl %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x377b2
leaq 0x5a223(%rip), %rsi     # 0xca5df
movl $0x4, %edx
movq %rbx, %rdi
callq 0x36ad1
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x703d3
xorl %ebp, %ebp
movq 0xa5e96(%rip), %rdi     # 0x116270
movq %rbx, %rsi
callq 0x2b24b
testb %bpl, %bpl
je 0x7041b
cmpl $0x0, 0xa5fca(%rip)     # 0x1163b8
jne 0x7041b
movl $0x1, 0xa5fbe(%rip)     # 0x1163b8
leaq 0x5a1e3(%rip), %rdi     # 0xca5e4
callq 0x362b0
movq 0xa5e63(%rip), %rdi     # 0x116270
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2b24b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbSendLogs
void ldbSendLogs(void) {
    sds proto = sdsempty();
    proto = sdscatfmt(proto,"*%i\r\n", (int)listLength(ldb.logs));
    while(listLength(ldb.logs)) {
        listNode *ln = listFirst(ldb.logs);
        proto = sdscatlen(proto,"+",1);
        sdsmapchars(ln->value,"\r\n","  ",2);
        proto = sdscatsds(proto,ln->value);
        proto = sdscatlen(proto,"\r\n",2);
        listDelNode(ldb.logs,ln);
    }
    if (write(ldb.fd,proto,sdslen(proto)) == -1) {
        /* Avoid warning. We don't check the return value of write()
         * since the next read() will catch the I/O error and will
         * close the debugging session. */
    }
    sdsfree(proto);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
callq 0x3628d
movq 0xa5e39(%rip), %rcx     # 0x116270
movl 0x28(%rcx), %edx
leaq 0x5a1eb(%rip), %rsi     # 0xca62c
movq %rax, %rdi
xorl %eax, %eax
callq 0x36fb1
movq %rax, %rbx
movq 0xa5e1b(%rip), %rax     # 0x116270
cmpq $0x0, 0x28(%rax)
je 0x704d7
leaq 0x4cbaf(%rip), %r14     # 0xbd012
leaq 0x53972(%rip), %r15     # 0xc3ddc
leaq 0x5a2ea(%rip), %r12     # 0xca75b
movq (%rax), %r13
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36ad1
movq %rax, %rbx
movq 0x10(%r13), %rdi
movl $0x2, %ecx
movq %r15, %rsi
movq %r12, %rdx
callq 0x3812f
movq 0x10(%r13), %rsi
movq %rbx, %rdi
callq 0x36bc3
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x36ad1
movq %rax, %rbx
movq 0xa5daf(%rip), %rdi     # 0x116270
movq %r13, %rsi
callq 0x2b331
movq 0xa5da0(%rip), %rax     # 0x116270
cmpq $0x0, 0x28(%rax)
jne 0x70471
movl 0xa5d83(%rip), %edi     # 0x116260
movzbl -0x1(%rbx), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x70517
leaq 0x592da(%rip), %rcx     # 0xc97cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x70519
movq -0x11(%rbx), %rdx
jmp 0x70519
movzwl -0x5(%rbx), %edx
jmp 0x70519
movl -0x9(%rbx), %edx
jmp 0x70519
movzbl -0x3(%rbx), %edx
jmp 0x70519
xorl %edx, %edx
movq %rbx, %rsi
callq 0x26bb0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x36330
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbEndSession
void ldbEndSession(client *c) {
    /* Emit the remaining logs and an <endsession> mark. */
    ldbLog(sdsnew("<endsession>"));
    ldbSendLogs();

    /* If it's a fork()ed session, we just exit. */
    if (ldb.forked) {
        writeToClient(c->fd, c, 0);
        serverLog(LL_WARNING,"Lua debugging session child exiting");
        exitFromChild(0);
    } else {
        serverLog(LL_WARNING,
            "Redis synchronous debugging eval session ended");
    }

    /* Otherwise let's restore client's state. */
    anetNonBlock(NULL,ldb.fd);
    anetSendTimeout(NULL,ldb.fd,0);

    /* Close the client connectin after sending the final EVAL reply
     * in order to signal the end of the debugging session. */
    c->flags |= CLIENT_CLOSE_AFTER_REPLY;

    /* Cleanup. */
    sdsfreesplitres(ldb.src,ldb.lines);
    ldb.lines = 0;
    ldb.active = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x59efd(%rip), %rdi     # 0xca6b4
callq 0x362b0
movq 0xa5aad(%rip), %rdi     # 0x116270
movq %rax, %rsi
callq 0x2b24b
callq 0x70422
cmpl $0x0, 0xa5a91(%rip)     # 0x116268
je 0x70802
movl 0x8(%rbx), %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3db7a
leaq 0x59ed4(%rip), %rsi     # 0xca6c1
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
xorl %edi, %edi
callq 0x3000c
jmp 0x70815
leaq 0x59edc(%rip), %rsi     # 0xca6e5
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
movl 0xa5a45(%rip), %esi     # 0x116260
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x2d6a1
movl 0xa5a35(%rip), %esi     # 0x116260
xorl %edi, %edi
xorl %edx, %edx
callq 0x2d8f0
orb $0x40, 0x98(%rbx)
movq 0xa5b56(%rip), %rdi     # 0x116398
movl 0xa5b58(%rip), %esi     # 0x1163a0
callq 0x37c04
movl %r14d, 0xa5b4c(%rip)    # 0x1163a0
movl %r14d, 0xa5a09(%rip)    # 0x116264
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbRemoveChild
int ldbRemoveChild(pid_t pid) {
    listNode *ln = listSearchKey(ldb.children,(void*)(unsigned long)pid);
    if (ln) {
        listDelNode(ldb.children,ln);
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rax
movq 0xa5a15(%rip), %rax     # 0x116280
movslq %edi, %rsi
movq %rax, %rdi
callq 0x2b470
testq %rax, %rax
je 0x70891
movq 0xa59fe(%rip), %rdi     # 0x116280
movq %rax, %rsi
callq 0x2b331
movl $0x1, %eax
jmp 0x70893
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbKillForkedSessions
void ldbKillForkedSessions(void) {
    listIter li;
    listNode *ln;

    listRewind(ldb.children,&li);
    while((ln = listNext(&li))) {
        pid_t pid = (unsigned long) ln->value;
        serverLog(LL_WARNING,"Killing debugging session %ld",(long)pid);
        kill(pid,SIGKILL);
    }
    listRelease(ldb.children);
    ldb.children = listCreate();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq 0xa59d0(%rip), %rdi     # 0x116280
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x2b3b7
movq %rbx, %rdi
callq 0x2b3d4
testq %rax, %rax
je 0x70905
leaq 0x59e45(%rip), %rbx     # 0xca714
movq %rsp, %r14
movq 0x10(%rax), %rax
movslq %eax, %r15
movl $0x3, %edi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2fdad
movl %r15d, %edi
movl $0x9, %esi
callq 0x26660
movq %r14, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x708d2
movq 0xa5974(%rip), %rdi     # 0x116280
callq 0x2b19c
callq 0x2b17c
movq %rax, 0xa5963(%rip)     # 0x116280
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbIsBreakpoint
int ldbIsBreakpoint(int line) {
    int j;

    for (j = 0; j < ldb.bpcount; j++)
        if (ldb.bp[j] == line) return 1;
    return 0;
}

// Assembly:
movslq 0xa5a38(%rip), %rax     # 0x116388
testq %rax, %rax
jle 0x7096c
xorl %ecx, %ecx
leaq 0xa5902(%rip), %rdx     # 0x116260
cmpl %edi, 0x28(%rdx,%rcx,4)
je 0x7096f
incq %rcx
cmpq %rcx, %rax
jne 0x7095e
xorl %eax, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbAddBreakpoint
int ldbAddBreakpoint(int line) {
    if (line <= 0 || line > ldb.lines) return 0;
    if (!ldbIsBreakpoint(line) && ldb.bpcount != LDB_BREAKPOINTS_MAX) {
        ldb.bp[ldb.bpcount++] = line;
        return 1;
    }
    return 0;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
jle 0x709bf
cmpl %edi, 0xa5a1f(%rip)     # 0x1163a0
jl 0x709bf
movslq 0xa59fe(%rip), %rcx     # 0x116388
leaq 0xa58cf(%rip), %rdx     # 0x116260
testq %rcx, %rcx
jle 0x709ad
xorl %eax, %eax
xorl %esi, %esi
cmpl %edi, 0x28(%rdx,%rsi,4)
je 0x709bf
incq %rsi
cmpq %rsi, %rcx
jne 0x7099a
cmpl $0x40, %ecx
je 0x709bf
leal 0x1(%rcx), %eax
movl %eax, 0xa59d2(%rip)     # 0x116388
movl %edi, 0x28(%rdx,%rcx,4)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbDelBreakpoint
int ldbDelBreakpoint(int line) {
    int j;

    for (j = 0; j < ldb.bpcount; j++) {
        if (ldb.bp[j] == line) {
            ldb.bpcount--;
            memmove(ldb.bp+j,ldb.bp+j+1,ldb.bpcount-j);
            return 1;
        }
    }
    return 0;
}

// Assembly:
movslq 0xa59c1(%rip), %rax     # 0x116388
testq %rax, %rax
jle 0x709e3
xorl %ecx, %ecx
leaq 0xa588b(%rip), %rdx     # 0x116260
cmpl %edi, 0x28(%rdx,%rcx,4)
je 0x709e6
incq %rcx
cmpq %rcx, %rax
jne 0x709d5
xorl %eax, %eax
retq
pushq %rax
leaq (%rdx,%rcx,4), %rdi
addq $0x28, %rdi
decl %eax
movl %eax, 0xa5991(%rip)     # 0x116388
leaq (%rdx,%rcx,4), %rsi
addq $0x2c, %rsi
movslq %eax, %rdx
subq %rcx, %rdx
callq 0x267e0
movl $0x1, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbLogSourceLine
void ldbLogSourceLine(int lnum) {
    char *line = ldbGetSourceLine(lnum);
    char *prefix;
    int bp = ldbIsBreakpoint(lnum);
    int current = ldb.currentline == lnum;

    if (current && bp)
        prefix = "->#";
    else if (current)
        prefix = "-> ";
    else if (bp)
        prefix = "  #";
    else
        prefix = "   ";
    sds thisline = sdscatprintf(sdsempty(),"%s%-3d %s", prefix, lnum, line);
    ldbLog(thisline);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x59ba5(%rip), %r14     # 0xca732
testl %edi, %edi
jle 0x70ba7
cmpl %ebx, 0xa5809(%rip)     # 0x1163a0
jl 0x70ba7
movq 0xa57f8(%rip), %rax     # 0x116398
movl %ebx, %ecx
movq -0x8(%rax,%rcx,8), %r14
movslq 0xa57da(%rip), %rcx     # 0x116388
leaq 0x51e06(%rip), %rax     # 0xc29bb
leaq 0x59b9e(%rip), %r15     # 0xca75a
testq %rcx, %rcx
jle 0x70bee
xorl %edx, %edx
leaq 0xa5696(%rip), %rdi     # 0x116260
leaq 0x59b81(%rip), %rsi     # 0xca752
leaq 0x59b7e(%rip), %r8      # 0xca756
cmpl %ebx, 0x28(%rdi,%rdx,4)
je 0x70be8
incq %rdx
cmpq %rdx, %rcx
jne 0x70bd8
jmp 0x70bee
movq %r8, %r15
movq %rsi, %rax
cmpl %ebx, 0xa57b0(%rip)     # 0x1163a4
cmoveq %rax, %r15
callq 0x3628d
leaq 0x59b5a(%rip), %rsi     # 0xca75e
movq %rax, %rdi
movq %r15, %rdx
movl %ebx, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x36f2d
movq 0xa5653(%rip), %rdi     # 0x116270
movq %rax, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2b24b