LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4bb10(%rip), %rdx     # 0xae338
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x78d22
leaq 0x4bf40(%rip), %rsi     # 0xae779
movq %rbx, %rdi
callq 0x78aec
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x78d02
pushq $-0x3
popq %rsi
movq %rbx, %rdi
callq 0x78698
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x79168
testl %eax, %eax
je 0x628bc
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x78478
leaq 0x4befb(%rip), %rsi     # 0xae779
movq %rbx, %rdi
callq 0x78aec
movq %rbx, %rdi
movl %ebp, %esi
callq 0x78d02
pushq $-0x3
popq %rsi
movq %rbx, %rdi
callq 0x78698
leaq 0x57ee8(%rip), %rdx     # 0xba78a
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x78d22
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x79130
pushq $-0x2
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x78478
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
callq 0x7846b
cmpl $0x1, %eax
jne 0x6343d
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x788e1
movq (%r14), %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x623fc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x78aec
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x528d3(%rip), %rsi     # 0xb5d17
movq %rbx, %rdi
callq 0x78aec
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x793e7
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0x7846b
cmpl $0x1, %eax
jne 0x634b0
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x786b8
cmpl $0x4, %eax
jne 0x634b0
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x78ddb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x78aec
pushq $-0x3
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x78698
movq %rbx, %rdi
movl %ebp, %esi
callq 0x78ed3
jmp 0x634bf
leaq 0x57569(%rip), %rsi     # 0xbaa20
movq %rbx, %rdi
callq 0x6270d
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x963b0(%rip), %rax     # 0xf98a8
xorl %ebp, %ebp
cmpl $0x0, 0x9f8(%rax)
jne 0x6351c
pushq $0x1
popq %rbp
movl $0x1, 0xa00(%rax)
callq 0x26b70
movl %eax, %edi
callq 0x670eb
movq %rbx, %rdi
movl %ebp, %esi
callq 0x78cb0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0xaad08(%rip)     # 0x10e264
je 0x635cc
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x7846b
movl %eax, %ebp
callq 0x3114c
movl 0xaae2a(%rip), %edx     # 0x10e3a4
leaq 0x574c1(%rip), %rsi     # 0xbaa42
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
negl %ebp
leaq 0x574c0(%rip), %r14     # 0xbaa54
pushq $0x2
popq %r15
movq %rax, %rdi
testl %ebp, %ebp
je 0x635bd
movq %rbx, %rsi
movl %ebp, %edx
callq 0x635cf
incl %ebp
je 0x63598
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x31758
jmp 0x63598
callq 0x627e8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7846b
leaq 0x962bf(%rip), %r14     # 0xf98a8
cmpl $0x0, 0xa00(%r14)
je 0x6361d
cmpl $0x1, %eax
jne 0x63626
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x7885f
cvttsd2si %xmm0, %eax
cmpl $0x4, %eax
jae 0x6362f
movl %eax, 0xa08(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x57433(%rip), %rsi     # 0xbaa57
jmp 0x63636
leaq 0x574a2(%rip), %rsi     # 0xbaacf
jmp 0x63636
leaq 0x574c2(%rip), %rsi     # 0xbaaf8
movq %rbx, %rdi
callq 0x78aec
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x793e7
// File: /workspace/github_c_makefile_star2_O2/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 0x7846b
cmpl $0x1, %eax
jg 0x63671
leaq 0x574d5(%rip), %rsi     # 0xbab44
jmp 0x636a9
movl %eax, %r15d
movl %eax, %ebp
negl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7870f
testl %eax, %eax
je 0x636a2
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7885f
cvttsd2si %xmm0, %eax
cmpl $0x4, %eax
jb 0x636c7
leaq 0x574fd(%rip), %rsi     # 0xbab9d
jmp 0x636a9
leaq 0x574c7(%rip), %rsi     # 0xbab70
movq %rbx, %rdi
callq 0x78aec
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x793e7
movl %eax, 0xc(%rsp)
callq 0x3114c
movq %rax, %r14
pushq $0x1
popq %r12
subl %r15d, %r12d
xorl %r13d, %r13d
leaq 0x10(%rsp), %r15
movl %r12d, %esi
addl %r13d, %esi
je 0x6372f
movq %rbx, %rdi
movq %r15, %rdx
callq 0x788e1
testq %rax, %rax
je 0x6372a
movq %rax, %rbp
testl %r13d, %r13d
je 0x63717
movq %r14, %rdi
leaq 0x52945(%rip), %rsi     # 0xb6051
pushq $0x1
popq %rdx
callq 0x31758
movq %rax, %r14
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x31758
movq %rax, %r14
incl %r13d
jmp 0x636e2
movl 0xc(%rsp), %edi
movq %r14, %rsi
callq 0x2b51f
movq %r14, %rdi
callq 0x311c8
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_O2/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 0x4ec73(%rip), %rsi     # 0xb2405
leaq 0x1fe73(%rip), %rdx     # 0x8360c
callq 0x63754
leaq 0x4ab93(%rip), %rsi     # 0xae338
leaq 0x223e4(%rip), %rdx     # 0x85b90
movq %rbx, %rdi
callq 0x63754
leaq 0x5e2b4(%rip), %rsi     # 0xc1a6f
leaq 0x22c96(%rip), %rdx     # 0x86458
movq %rbx, %rdi
callq 0x63754
leaq 0x573e1(%rip), %rsi     # 0xbabb2
leaq 0x21d1c(%rip), %rdx     # 0x854f4
movq %rbx, %rdi
callq 0x63754
leaq 0x60b26(%rip), %rsi     # 0xc430d
leaq 0x2102e(%rip), %rdx     # 0x8481c
movq %rbx, %rdi
callq 0x63754
leaq 0x573ba(%rip), %rsi     # 0xbabb7
leaq 0x246b0(%rip), %rdx     # 0x87eb4
movq %rbx, %rdi
callq 0x63754
leaq 0x573aa(%rip), %rsi     # 0xbabbd
leaq 0x25d8e(%rip), %rdx     # 0x895a8
movq %rbx, %rdi
callq 0x63754
leaq 0x5739b(%rip), %rsi     # 0xbabc4
leaq 0x277ff(%rip), %rdx     # 0x8b02f
movq %rbx, %rdi
callq 0x63754
leaq 0x5f3fb(%rip), %rsi     # 0xc2c3a
leaq 0x278ae(%rip), %rdx     # 0x8b0f4
movq %rbx, %rdi
popq %rbx
jmp 0x63754
// File: /workspace/github_c_makefile_star2_O2/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 0x78a55
leaq 0x5736e(%rip), %rdx     # 0xbabcd
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x78efa
movq %rbx, %rdi
callq 0x78a55
leaq 0x5735b(%rip), %rdx     # 0xbabd6
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
popq %rbx
jmp 0x78efa
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: scriptingEnableGlobalsProtection
void scriptingEnableGlobalsProtection(lua_State *lua) {
    char *s[32];
    sds code = sdsempty();
    int j = 0;

    /* strict.lua from: http://metalua.luaforge.net/src/lib/strict.lua.html.
     * Modified to be adapted to Redis. */
    s[j++]="local dbg=debug\n";
    s[j++]="local mt = {}\n";
    s[j++]="setmetatable(_G, mt)\n";
    s[j++]="mt.__newindex = function (t, n, v)\n";
    s[j++]="  if dbg.getinfo(2) then\n";
    s[j++]="    local w = dbg.getinfo(2, \"S\").what\n";
    s[j++]="    if w ~= \"main\" and w ~= \"C\" then\n";
    s[j++]="      error(\"Script attempted to create global variable '\"..tostring(n)..\"'\", 2)\n";
    s[j++]="    end\n";
    s[j++]="  end\n";
    s[j++]="  rawset(t, n, v)\n";
    s[j++]="end\n";
    s[j++]="mt.__index = function (t, n)\n";
    s[j++]="  if dbg.getinfo(2) and dbg.getinfo(2, \"S\").what ~= \"C\" then\n";
    s[j++]="    error(\"Script attempted to access unexisting global variable '\"..tostring(n)..\"'\", 2)\n";
    s[j++]="  end\n";
    s[j++]="  return rawget(t, n)\n";
    s[j++]="end\n";
    s[j++]="debug = nil\n";
    s[j++]=NULL;

    for (j = 0; s[j] != NULL; j++) code = sdscatlen(code,s[j],strlen(s[j]));
    luaL_loadbuffer(lua,code,sdslen(code),"@enable_strict_lua");
    lua_pcall(lua,0,0,0);
    sdsfree(code);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0x3114c
movq %rax, %r14
leaq 0x57334(%rip), %r15     # 0xbabdd
leaq 0x8(%rsp), %r12
movq %r15, -0x8(%r12)
leaq 0x57334(%rip), %rax     # 0xbabee
movq %rax, (%r12)
leaq 0x57338(%rip), %rax     # 0xbabfd
movq %rax, 0x8(%r12)
leaq 0x57342(%rip), %rax     # 0xbac13
movq %rax, 0x10(%r12)
leaq 0x5735a(%rip), %rax     # 0xbac37
movq %rax, 0x18(%r12)
leaq 0x57368(%rip), %rax     # 0xbac51
movq %rax, 0x20(%r12)
leaq 0x57384(%rip), %rax     # 0xbac79
movq %rax, 0x28(%r12)
leaq 0x5739e(%rip), %rax     # 0xbac9f
movq %rax, 0x30(%r12)
leaq 0x573e4(%rip), %rax     # 0xbacf1
movq %rax, 0x38(%r12)
leaq 0x573da(%rip), %rax     # 0xbacf3
movq %rax, 0x40(%r12)
leaq 0x573d5(%rip), %rcx     # 0xbacfa
movq %rcx, 0x48(%r12)
leaq 0x575e4(%rip), %rcx     # 0xbaf15
movq %rcx, 0x50(%r12)
leaq 0x573d0(%rip), %rdx     # 0xbad0d
movq %rdx, 0x58(%r12)
leaq 0x573e2(%rip), %rdx     # 0xbad2b
movq %rdx, 0x60(%r12)
leaq 0x57414(%rip), %rdx     # 0xbad69
movq %rdx, 0x68(%r12)
movq %rax, 0x70(%r12)
leaq 0x5745e(%rip), %rax     # 0xbadc4
movq %rax, 0x78(%r12)
movq %rcx, 0x80(%r12)
leaq 0x57461(%rip), %rax     # 0xbaddb
movq %rax, 0x88(%r12)
andq $0x0, 0x90(%r12)
testq %r15, %r15
je 0x639b3
movq %r15, %rdi
callq 0x26500
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x31758
movq %rax, %r14
movq (%r12), %r15
addq $0x8, %r12
jmp 0x6398b
movq %r14, %rdi
callq 0x63370
leaq 0x57426(%rip), %rcx     # 0xbade8
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x83534
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x79168
movq %r14, %rdi
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x311c8
// File: /workspace/github_c_makefile_star2_O2/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, 0xaa3f0(%rip)     # 0x10e260
callq 0x26e0c
movq %rax, 0xaa3f4(%rip)     # 0x10e270
leaq -0x32cbb(%rip), %rcx    # 0x311c8
movq %rcx, 0x18(%rax)
callq 0x26e0c
movq %rax, 0xaa3ed(%rip)     # 0x10e280
andq $0x0, 0xaa4fd(%rip)     # 0x10e398
andl $0x0, 0xaa4fe(%rip)     # 0x10e3a0
callq 0x3114c
movq %rax, 0xaa4fa(%rip)     # 0x10e3a8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x67024
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cltd
idivl %ecx
cvtsi2sd %edx, %xmm0
divsd 0x56891(%rip), %xmm0    # 0xba768
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x7846b
cmpl $0x2, %eax
je 0x63f48
cmpl $0x1, %eax
je 0x63f05
testl %eax, %eax
jne 0x63fb0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
jmp 0x63f9e
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x82b7a
movq %rax, %r14
testl %r14d, %r14d
jg 0x63f2a
leaq 0x5711a(%rip), %rdx     # 0xbb039
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x82650
cvtsi2sd %r14d, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x26b50
addsd 0x4e47a(%rip), %xmm0    # 0xb23c0
jmp 0x63f9b
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x82b7a
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x82b7a
movq %rax, %r15
subl %r14d, %r15d
jge 0x63f7b
leaq 0x570c9(%rip), %rdx     # 0xbb039
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x82650
incl %r15d
cvtsi2sd %r15d, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x26b50
cvtsi2sd %r14d, %xmm1
addsd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x78a66
pushq $0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x51d60(%rip), %rsi     # 0xb5d17
movq %rbx, %rdi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x82707
// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movq %rdx, %r15
movq %rsi, (%rsp)
movq %rdi, %r12
xorl %r13d, %r13d
xorl %esi, %esi
xorl %edx, %edx
callq 0x78ddb
testl %r14d, %r14d
cmovlel %r13d, %r14d
pushq $-0x2
popq %rbp
cmpq %r13, %r14
je 0x64070
movq (%r15,%r13,8), %rax
movq 0x8(%rax), %rbx
movq %rbx, %rdi
callq 0x63370
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x78a95
incq %r13
movq %r12, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0x78fbe
jmp 0x6403b
movq %r12, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
movq (%rsp), %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x78efa
// File: /workspace/github_c_makefile_star2_O2/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 0x2b8ae
leaq 0x95673(%rip), %r14     # 0xf98a8
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 0x64298
leaq 0x56e68(%rip), %rsi     # 0xbb0cb
pushq $0x3
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2b699
movl $0x1, 0xa0c(%r14)
movq 0x40(%r14), %rdi
movq 0x9d8(%r14), %rax
movl 0x8(%rax), %esi
pushq $0x1
popq %rdx
callq 0x28ba8
movl 0xa0c(%r14), %ecx
testl %ecx, %ecx
je 0x642a1
callq 0x39254
cmpl $0x0, 0xa10(%r14)
je 0x642da
leaq 0x56e9d(%rip), %rsi     # 0xbb14f
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
leaq 0x56eb8(%rip), %rsi     # 0xbb17b
movq %rbx, %rdi
callq 0x78aec
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x793e7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x64ed0
testl %eax, %eax
je 0x6495b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x642e2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x65055
andb $-0x7, 0x9b(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x63370
cmpq $0x28, %rax
jne 0x64999
testb $0x2, 0x9b(%rbx)
jne 0x649b0
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x642e2
leaq 0x95970(%rip), %rax     # 0xfa310
movq 0x98(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x36987
leaq 0x568b6(%rip), %rsi     # 0xbb26d
movq %rbx, %rdi
popq %rbx
jmp 0x36b6f
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
orb $0x2, 0x9b(%rdi)
movq 0xa956e(%rip), %rdi     # 0x10e270
callq 0x64d54
movl 0x8(%rbx), %eax
movl %eax, 0xa9550(%rip)     # 0x10e260
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0xa9667(%rip)     # 0x10e388
andl $0x0, 0xa9668(%rip)     # 0x10e390
movq 0xa9679(%rip), %rdi     # 0x10e3a8
callq 0x311c8
callq 0x3114c
movq %rax, 0xa9668(%rip)     # 0x10e3a8
movq $0x100, 0xa9665(%rip) # imm = 0x100
andl $0x0, 0xa9666(%rip)     # 0x10e3b8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %rbx
movq 0xa9636(%rip), %r14     # 0x10e3b0
testq %r14, %r14
je 0x64db6
movq %rbx, %rdi
callq 0x63370
cmpq %r14, %rax
jbe 0x64db6
decl %r14d
movq %rbx, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x31e8e
leaq 0x5666c(%rip), %rsi     # 0xbb40f
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x31758
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x64db8
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x627e8
testb %bpl, %bpl
je 0x64df0
cmpl $0x0, 0xa95ec(%rip)     # 0x10e3b8
jne 0x64df0
movl $0x1, 0xa95e0(%rip)     # 0x10e3b8
leaq 0x56635(%rip), %rdi     # 0xbb414
callq 0x3115a
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x627e8
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x3114c
movq 0xa9464(%rip), %rcx     # 0x10e270
movl 0x28(%rcx), %edx
leaq 0x56646(%rip), %rsi     # 0xbb45c
movq %rax, %rdi
xorl %eax, %eax
callq 0x31abc
movq %rax, %rbp
pushq $0x1
popq %r14
leaq 0x50362(%rip), %r15     # 0xb5190
leaq 0x56756(%rip), %r12     # 0xbb58b
pushq $0x2
popq %r13
movq 0xa9430(%rip), %rax     # 0x10e270
cmpq $0x0, 0x28(%rax)
je 0x64e9f
movq (%rax), %rbx
movq %rbp, %rdi
leaq 0x4a0ae(%rip), %rsi     # 0xaef02
movq %r14, %rdx
callq 0x31758
movq %rax, %rbp
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3269b
movq 0x10(%rbx), %rsi
movq %rbp, %rdi
callq 0x317de
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x31758
movq %rax, %rbp
movq 0xa93db(%rip), %rdi     # 0x10e270
movq %rbx, %rsi
callq 0x26fa8
jmp 0x64e39
movl 0xa93bb(%rip), %ebx     # 0x10e260
movq %rbp, %rdi
callq 0x63370
movl %ebx, %edi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x26bb0
movq %rbp, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x311c8
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
leaq 0x56484(%rip), %rdi     # 0xbb4e4
callq 0x3115a
movq %rax, %rdi
callq 0x627e8
callq 0x64df5
cmpl $0x0, 0xa91ef(%rip)     # 0x10e268
je 0x650a2
movl 0x8(%rbx), %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x37945
leaq 0x56462(%rip), %rsi     # 0xbb4f1
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
xorl %edi, %edi
callq 0x2b8c0
jmp 0x650b3
leaq 0x5646c(%rip), %rsi     # 0xbb515
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
movl 0xa91a7(%rip), %esi     # 0x10e260
xorl %edi, %edi
callq 0x2929c
movl 0xa919a(%rip), %esi     # 0x10e260
xorl %edi, %edi
xorl %edx, %edx
callq 0x294a4
orb $0x40, 0x98(%rbx)
movq 0xa92bb(%rip), %rdi     # 0x10e398
movl 0xa92bd(%rip), %esi     # 0x10e3a0
callq 0x321be
andl $0x0, 0xa92b1(%rip)     # 0x10e3a0
andl $0x0, 0xa916e(%rip)     # 0x10e264
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa9180(%rip), %rax     # 0x10e280
movslq %edi, %rsi
movq %rax, %rdi
callq 0x270cf
testq %rax, %rax
je 0x65124
movq 0xa9169(%rip), %rdi     # 0x10e280
movq %rax, %rsi
callq 0x26fa8
pushq $0x1
popq %rax
jmp 0x65126
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0xa913a(%rip), %rdi     # 0x10e280
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x2702c
leaq 0x563ec(%rip), %r14     # 0xbb544
pushq $0x3
popq %rbp
pushq $0x9
popq %r15
movq %rbx, %rdi
callq 0x27046
testq %rax, %rax
je 0x6518f
movq 0x10(%rax), %rax
movslq %eax, %r12
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2b699
movl %r12d, %edi
movl %r15d, %esi
callq 0x26660
jmp 0x6515f
movq 0xa90ea(%rip), %rdi     # 0x10e280
callq 0x26e2a
callq 0x26e0c
movq %rax, 0xa90d9(%rip)     # 0x10e280
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testl %edi, %edi
jle 0x6524d
movl %edi, %ebp
cmpl %edi, 0xa918d(%rip)     # 0x10e3a0
jl 0x6524d
movl %ebp, %edi
callq 0x651d6
testl %eax, %eax
sete %cl
movl 0xa9161(%rip), %eax     # 0x10e388
cmpl $0x40, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x6524d
movslq %eax, %rcx
incl %eax
movl %eax, 0xa9149(%rip)     # 0x10e388
leaq 0xa901a(%rip), %rax     # 0x10e260
movl %ebp, 0x28(%rax,%rcx,4)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movl 0xa912c(%rip), %ecx     # 0x10e388
xorl %eax, %eax
testl %ecx, %ecx
movl $0x0, %esi
cmovgl %ecx, %esi
leaq 0xa8ff1(%rip), %rdx     # 0x10e260
xorl %r8d, %r8d
cmpq %r8, %rsi
je 0x652ae
cmpl %edi, 0x28(%rdx,%r8,4)
je 0x65283
incq %r8
jmp 0x65272
pushq %rax
leaq (%rdx,%r8,4), %rdi
addq $0x28, %rdi
decl %ecx
movl %ecx, 0xa90f4(%rip)     # 0x10e388
leaq (%rdx,%r8,4), %rsi
addq $0x2c, %rsi
movslq %ecx, %rdx
subq %r8, %rdx
callq 0x267e0
pushq $0x1
popq %rax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbReplParseCommand
sds *ldbReplParseCommand(int *argcp) {
    sds *argv = NULL;
    int argc = 0;
    if (sdslen(ldb.cbuf) == 0) return NULL;

    /* Working on a copy is simpler in this case. We can modify it freely
     * for the sake of simpler parsing. */
    sds copy = sdsdup(ldb.cbuf);
    char *p = copy;

    /* This Redis protocol parser is a joke... just the simplest thing that
     * works in this context. It is also very forgiving regarding broken
     * protocol. */

    /* Seek and parse *<count>\r\n. */
    p = strchr(p,'*'); if (!p) goto protoerr;
    char *plen = p+1; /* Multi bulk len pointer. */
    p = strstr(p,"\r\n"); if (!p) goto protoerr;
    *p = '\0'; p += 2;
    *argcp = atoi(plen);
    if (*argcp <= 0 || *argcp > 1024) goto protoerr;

    /* Parse each argument. */
    argv = zmalloc(sizeof(sds)*(*argcp));
    argc = 0;
    while(argc < *argcp) {
        if (*p != '$') goto protoerr;
        plen = p+1; /* Bulk string len pointer. */
        p = strstr(p,"\r\n"); if (!p) goto protoerr;
        *p = '\0'; p += 2;
        int slen = atoi(plen); /* Length of this arg. */
        if (slen <= 0 || slen > 1024) goto protoerr;
        argv[argc++] = sdsnewlen(p,slen);
        p += slen; /* Skip the already parsed argument. */
        if (p[0] != '\r' || p[1] != '\n') goto protoerr;
        p += 2; /* Skip \r\n. */
    }
    sdsfree(copy);
    return argv;

protoerr:
    sdsfreesplitres(argv,argc);
    sdsfree(copy);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0xa90e4(%rip), %rbx     # 0x10e3a8
movq %rbx, %rdi
callq 0x63370
xorl %r15d, %r15d
testq %rax, %rax
je 0x65346
movq %rbx, %rdi
callq 0x3117b
movq %rax, %rbx
pushq $0x2a
popq %rsi
movq %rax, %rdi
callq 0x267f0
testq %rax, %rax
je 0x6532b
movq %rax, %r12
leaq 0x4fe97(%rip), %rsi     # 0xb5190
movq %rax, %rdi
callq 0x266b0
testq %rax, %rax
je 0x65328
movq %rax, %r13
incq %r12
movb $0x0, (%rax)
movq %r12, %rdi
callq 0x26760
movl %eax, (%r14)
leal -0x401(%rax), %ecx
cmpl $0xfffffc00, %ecx       # imm = 0xFFFFFC00
jae 0x6535b
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r12, %rdi
movl %r15d, %esi
callq 0x321be
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x311c8
jmp 0x65349
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shll $0x3, %eax
movq %rax, %rdi
callq 0x327b9
movq %rax, %r12
xorl %r15d, %r15d
movslq (%r14), %rax
cmpq %rax, %r15
jge 0x6533c
leaq 0x2(%r13), %rdi
cmpb $0x24, (%rdi)
jne 0x6532e
leaq 0x4fe0c(%rip), %rsi     # 0xb5190
callq 0x266b0
testq %rax, %rax
je 0x6532e
movq %rax, %rbp
addq $0x3, %r13
movb $0x0, (%rax)
movq %r13, %rdi
callq 0x26760
leal -0x401(%rax), %ecx
cmpl $0xfffffc00, %ecx       # imm = 0xFFFFFC00
jb 0x6532e
leaq 0x2(%rbp), %rdi
movl %eax, %r13d
movq %r13, %rsi
callq 0x31018
movq %rax, (%r12,%r15,8)
cmpb $0xd, 0x2(%rbp,%r13)
jne 0x653df
addq %rbp, %r13
addq $0x2, %r13
incq %r15
cmpb $0xa, 0x1(%r13)
je 0x6536c
jmp 0x6532e
incq %r15
jmp 0x6532e
// File: /workspace/github_c_makefile_star2_O2/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 0x5616d(%rip), %r14     # 0xbb562
testl %edi, %edi
jle 0x6540f
cmpl %ebx, 0xa8fa1(%rip)     # 0x10e3a0
jl 0x6540f
movq 0xa8f90(%rip), %rax     # 0x10e398
movl %ebx, %ecx
movq -0x8(%rax,%rcx,8), %r14
movl %ebx, %edi
callq 0x651d6
testl %eax, %eax
leaq 0x5616b(%rip), %rax     # 0xbb58a
leaq 0x56160(%rip), %rcx     # 0xbb586
cmoveq %rax, %rcx
leaq 0x4ec4a(%rip), %rax     # 0xb407b
leaq 0x5614a(%rip), %r15     # 0xbb582
cmoveq %rax, %r15
cmpl %ebx, 0xa8f62(%rip)     # 0x10e3a4
cmovneq %rcx, %r15
callq 0x3114c
leaq 0x5613c(%rip), %rsi     # 0xbb58e
movq %rax, %rdi
movq %r15, %rdx
movl %ebx, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x31a38
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x627e8
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbList
void ldbList(int around, int context) {
    int j;

    for (j = 1; j <= ldb.lines; j++) {
        if (around != 0 && abs(around-j) > context) continue;
        ldbLogSourceLine(j);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
movl 0xa8f1d(%rip), %eax     # 0x10e3a0
leal -0x1(%r14), %r15d
pushq $0x1
popq %rbp
cmpl %eax, %ebp
jg 0x654b4
testl %r14d, %r14d
je 0x654a0
movl %r15d, %ecx
negl %ecx
cmovsl %r15d, %ecx
cmpl %ebx, %ecx
jg 0x654ad
movl %ebp, %edi
callq 0x653e7
movl 0xa8ef3(%rip), %eax     # 0x10e3a0
incl %ebp
decl %r15d
jmp 0x6548a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbRedisProtocolToHuman
char *ldbRedisProtocolToHuman(sds *o, char *reply) {
    char *p = reply;
    switch(*p) {
    case ':': p = ldbRedisProtocolToHuman_Int(o,reply); break;
    case '$': p = ldbRedisProtocolToHuman_Bulk(o,reply); break;
    case '+': p = ldbRedisProtocolToHuman_Status(o,reply); break;
    case '-': p = ldbRedisProtocolToHuman_Status(o,reply); break;
    case '*': p = ldbRedisProtocolToHuman_MultiBulk(o,reply); break;
    }
    return p;
}

// Assembly:
movzbl (%rsi), %ecx
leal -0x24(%rcx), %eax
cmpl $0x9, %eax
ja 0x65827
leaq 0x54efb(%rip), %rcx     # 0xba714
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x6590e
cmpl $0x3a, %ecx
jne 0x65831
jmp 0x6583f
movq %rsi, %rax
retq
jmp 0x65889
jmp 0x65949
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbRedisProtocolToHuman_Bulk
char *ldbRedisProtocolToHuman_Bulk(sds *o, char *reply) {
    char *p = strchr(reply+1,'\r');
    long long bulklen;

    string2ll(reply+1,p-reply-1,&bulklen);
    if (bulklen == -1) {
        *o = sdscatlen(*o,"NULL",4);
        return p+2;
    } else {
        *o = sdscatrepr(*o,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, %rbx
leaq 0x1(%rsi), %r12
pushq $0xd
popq %rsi
movq %r12, %rdi
callq 0x267f0
movq %rax, %r14
notq %r15
addq %rax, %r15
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x39865
movq (%r13), %rdx
movq (%rbx), %rdi
cmpq $-0x1, %rdx
je 0x658e7
addq $0x2, %r14
movq %r14, %rsi
callq 0x321f1
addq 0x8(%rsp), %r14
jmp 0x658f6
leaq 0x4f361(%rip), %rsi     # 0xb4c4f
pushq $0x4
popq %rdx
callq 0x31758
movq %rax, (%rbx)
addq $0x2, %r14
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbRedisProtocolToHuman_MultiBulk
char *ldbRedisProtocolToHuman_MultiBulk(sds *o, 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) {
        *o = sdscatlen(*o,"NULL",4);
        return p;
    }
    *o = sdscatlen(*o,"[",1);
    for (j = 0; j < mbulklen; j++) {
        p = ldbRedisProtocolToHuman(o,p);
        if (j != mbulklen-1) *o = sdscatlen(*o,",",1);
    }
    *o = sdscatlen(*o,"]",1);
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1(%rsi), %r12
pushq $0xd
popq %rsi
movq %r12, %rdi
callq 0x267f0
movq %rax, %r14
notq %r15
addq %rax, %r15
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x39865
addq $0x2, %r14
cmpq $-0x1, (%r13)
movq (%rbx), %rdi
je 0x659fb
leaq 0x55c35(%rip), %rsi     # 0xbb5d1
pushq $0x1
popq %r15
movq %r15, %rdx
callq 0x31758
movq %rax, (%rbx)
xorl %r13d, %r13d
leaq 0x54a1c(%rip), %r12     # 0xba3d1
cmpq %r13, 0x8(%rsp)
jle 0x659ed
movq %rbx, %rdi
movq %r14, %rsi
callq 0x65807
movq %rax, %r14
movq 0x8(%rsp), %rax
decq %rax
cmpq %rax, %r13
je 0x659e8
movq (%rbx), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x31758
movq %rax, (%rbx)
incq %r13
jmp 0x659b5
movq (%rbx), %rdi
leaq 0x5b66b(%rip), %rsi     # 0xc1062
pushq $0x1
jmp 0x65a04
leaq 0x4f24d(%rip), %rsi     # 0xb4c4f
pushq $0x4
popq %rdx
callq 0x31758
movq %rax, (%rbx)
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbPrint
void ldbPrint(lua_State *lua, char *varname) {
    lua_Debug ar;

    int l = 0; /* Stack level. */
    while (lua_getstack(lua,l,&ar) != 0) {
        l++;
        const char *name;
        int i = 1; /* Variable index. */
        while((name = lua_getlocal(lua,&ar,i)) != NULL) {
            i++;
            if (strcmp(varname,name) == 0) {
                ldbLogStackValue(lua,"<value> ");
                lua_pop(lua,1);
                return;
            } else {
                lua_pop(lua,1); /* Discard the var name on the stack. */
            }
        }
    }

    /* Let's try with global vars in two selected cases */
    if (!strcmp(varname,"ARGV") || !strcmp(varname,"KEYS")) {
        lua_getglobal(lua, varname);
        ldbLogStackValue(lua,"<value> ");
        lua_pop(lua,1);
    } else {
        ldbLog(sdsnew("No such variable."));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %ebp, %ebp
movq %rsp, %r15
pushq $0x1
popq %r13
pushq $-0x2
popq %r12
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x7967b
testl %eax, %eax
je 0x65a8a
incl %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0x796d3
testq %rax, %rax
je 0x65a84
movq %r14, %rdi
movq %rax, %rsi
callq 0x268f0
testl %eax, %eax
je 0x65ad6
incl %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x78478
jmp 0x65a52
pushq $0x1
popq %r13
jmp 0x65a3f
leaq 0x55797(%rip), %rsi     # 0xbb228
movq %r14, %rdi
callq 0x268f0
testl %eax, %eax
je 0x65ac6
leaq 0x5577f(%rip), %rsi     # 0xbb223
movq %r14, %rdi
callq 0x268f0
testl %eax, %eax
je 0x65ac6
leaq 0x55b68(%rip), %rdi     # 0xbb61f
callq 0x3115a
movq %rax, %rdi
callq 0x627e8
jmp 0x65af0
movq %rbx, %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
movq %r14, %rdx
callq 0x78d22
leaq 0x55b39(%rip), %rsi     # 0xbb616
movq %rbx, %rdi
callq 0x657e4
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x78478
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbPrintAll
void ldbPrintAll(lua_State *lua) {
    lua_Debug ar;
    int vars = 0;

    if (lua_getstack(lua,0,&ar) != 0) {
        const char *name;
        int i = 1; /* Variable index. */
        while((name = lua_getlocal(lua,&ar,i)) != NULL) {
            i++;
            if (!strstr(name,"(*temporary)")) {
                sds prefix = sdscatprintf(sdsempty(),"<value> %s = ",name);
                ldbLogStackValue(lua,prefix);
                sdsfree(prefix);
                vars++;
            }
            lua_pop(lua,1);
        }
    }

    if (vars == 0) {
        ldbLog(sdsnew("No local variables in the current context."));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movq %rsp, %rdx
xorl %esi, %esi
callq 0x7967b
testl %eax, %eax
je 0x65b9a
pushq $0x1
popq %rbp
movq %rsp, %r14
pushq $-0x2
popq %r13
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x796d3
testq %rax, %rax
je 0x65b95
movq %rax, %r12
movq %rax, %rdi
leaq 0x55ae7(%rip), %rsi     # 0xbb631
callq 0x266b0
testq %rax, %rax
jne 0x65b86
callq 0x3114c
movq %rax, %rdi
leaq 0x55adb(%rip), %rsi     # 0xbb63e
movq %r12, %rdx
xorl %eax, %eax
callq 0x31a38
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
callq 0x657e4
movq %r12, %rdi
callq 0x311c8
incl %r15d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x78478
incl %ebp
jmp 0x65b2b
testl %r15d, %r15d
jne 0x65bae
leaq 0x55aab(%rip), %rdi     # 0xbb64c
callq 0x3115a
movq %rax, %rdi
callq 0x627e8
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/scripting.c
// Function: ldbEval
void ldbEval(lua_State *lua, sds *argv, int argc) {
    /* Glue the script together if it is composed of multiple arguments. */
    sds code = sdsjoinsds(argv+1,argc-1," ",1);
    sds expr = sdscatsds(sdsnew("return "),code);

    /* Try to compile it as an expression, prepending "return ". */
    if (luaL_loadbuffer(lua,expr,sdslen(expr),"@ldb_eval")) {
        lua_pop(lua,1);
        /* Failed? Try as a statement. */
        if (luaL_loadbuffer(lua,code,sdslen(code),"@ldb_eval")) {
            ldbLog(sdscatfmt(sdsempty(),"<error> %s",lua_tostring(lua,-1)));
            lua_pop(lua,1);
            sdsfree(code);
            return;
        }
    }

    /* Call it. */
    sdsfree(code);
    sdsfree(expr);
    if (lua_pcall(lua,0,1,0)) {
        ldbLog(sdscatfmt(sdsempty(),"<error> %s",lua_tostring(lua,-1)));
        lua_pop(lua,1);
        return;
    }
    ldbLogStackValue(lua,"<retval> ");
    lua_pop(lua,1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rsi), %rdi
leal -0x1(%rdx), %esi
leaq 0x50316(%rip), %rdx     # 0xb6051
pushq $0x1
popq %rcx
callq 0x32742
movq %rax, %r14
leaq 0x55a02(%rip), %rdi     # 0xbb74f
callq 0x3115a
movq %rax, %rdi
movq %r14, %rsi
callq 0x317de
movq %rax, %r15
movq %rax, %rdi
callq 0x63370
leaq 0x559e8(%rip), %rcx     # 0xbb757
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x83534
testl %eax, %eax
je 0x65df6
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x78478
movq %r14, %rdi
callq 0x63370
leaq 0x559bc(%rip), %rcx     # 0xbb757
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x83534
testl %eax, %eax
je 0x65df6
callq 0x3114c
movq %rax, %r15
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x788e1
leaq 0x549a7(%rip), %rsi     # 0xba770
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x31abc
movq %rax, %rdi
callq 0x627e8
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x78478
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x311c8
movq %r14, %rdi
callq 0x311c8
movq %r15, %rdi
callq 0x311c8
pushq $0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x79168
testl %eax, %eax
je 0x65e4c
callq 0x3114c
movq %rax, %r14
pushq $-0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x788e1
leaq 0x5493b(%rip), %rsi     # 0xba770
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x31abc
movq %rax, %rdi
callq 0x627e8
jmp 0x65e5b
leaq 0x5590e(%rip), %rsi     # 0xbb761
movq %rbx, %rdi
callq 0x657e4
pushq $-0x2
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x78478