LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x0, 0x10475a(%rip)    # 0x18cb94
je 0x88467
cmpl $0x0, 0x104879(%rip)    # 0x18ccbc
je 0x88467
callq 0x384f0
movq %rax, %rdi
movq -0x10(%rbp), %rdx
leaq 0xbb408(%rip), %rsi     # 0x143860
movb $0x0, %al
callq 0x395b0
movq %rax, %rdi
callq 0x88530
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xad9e0
movq -0x8(%rbp), %rdi
leaq 0xb0989(%rip), %rsi     # 0x138e08
callq 0xad410
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq -0x88(%rbp), %rdx
callq 0xaec40
cmpl $0x0, %eax
je 0x88500
movq -0x8(%rbp), %rdi
leaq 0xbb3c2(%rip), %rsi     # 0x14386b
leaq -0x88(%rbp), %rdx
callq 0xaef40
cmpl $0x0, %eax
je 0x88500
callq 0x384f0
movq %rax, %rdi
movq -0x68(%rbp), %rdx
movl -0x60(%rbp), %ecx
movq -0x10(%rbp), %r8
leaq 0xbb39b(%rip), %rsi     # 0x14386f
movb $0x0, %al
callq 0x395b0
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0xad410
movq -0x90(%rbp), %rdi
callq 0x38620
jmp 0x8850d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xad410
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xadc40
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0xaed7c(%rip), %rdx     # 0x137338
callq 0xad850
movq -0x8(%rbp), %rdi
leaq 0xaf22d(%rip), %rsi     # 0x1377f9
callq 0xad410
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xad800
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xaca40
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xae1c0
cmpl $0x0, %eax
je 0x88663
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xac570
movq -0x8(%rbp), %rdi
leaq 0xaf1dc(%rip), %rsi     # 0x1377f9
callq 0xad410
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xad800
movq -0x8(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xaca40
movq -0x8(%rbp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0xbb22c(%rip), %rdx     # 0x14387a
callq 0xad850
movq -0x8(%rbp), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0xae140
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xac570
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xac540
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
je 0x8979c
movq -0x10(%rbp), %rdi
leaq 0xb5686(%rip), %rsi     # 0x13ee0f
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x897d7
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq -0x48(%rbp), %rdx
callq 0xacf60
movq %rax, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x87f70
movq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xad410
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xac540
cmpl $0x1, %eax
jne 0x89811
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xacaa0
cmpl $0x4, %eax
je 0x8982a
movq -0x10(%rbp), %rdi
leaq 0xba2f4(%rip), %rsi     # 0x143b10
callq 0x88420
movl $0x1, -0x4(%rbp)
jmp 0x89867
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xad9e0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xad410
movq -0x10(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xaca40
movq -0x10(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0xadc40
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xee8f5(%rip), %rax     # 0x1781d8
cmpl $0x0, 0x9f8(%rax)
je 0x898f9
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xad710
jmp 0x89924
leaq 0xee8d8(%rip), %rax     # 0x1781d8
movl $0x1, 0xa00(%rax)
callq 0x26b80
movl %eax, %edi
callq 0x8f240
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xad710
movl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: luaRedisBreakpointCommand
int luaRedisBreakpointCommand(lua_State *lua) {
    if (ldb.active) {
        ldb.luabp = 1;
        lua_pushboolean(lua,1);
    } else {
        lua_pushboolean(lua,0);
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0x103251(%rip)    # 0x18cb94
je 0x8995f
movl $0x1, 0x103371(%rip)    # 0x18ccc0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xad710
jmp 0x8996a
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xad710
movl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpl $0x0, 0x103201(%rip)    # 0x18cb94
jne 0x899a1
movl $0x0, -0x4(%rbp)
jmp 0x89a27
movq -0x10(%rbp), %rdi
callq 0xac540
movl %eax, -0x14(%rbp)
callq 0x384f0
movq %rax, %rdi
movl 0x103319(%rip), %edx    # 0x18ccd4
leaq 0xba170(%rip), %rsi     # 0x143b32
movb $0x0, %al
callq 0x395b0
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
je 0x89a17
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subl -0x14(%rbp), %edx
callq 0x89a30
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x89a15
movq -0x20(%rbp), %rdi
leaq 0xba13d(%rip), %rsi     # 0x143b44
movl $0x2, %edx
callq 0x39040
movq %rax, -0x20(%rbp)
jmp 0x899cd
movq -0x20(%rbp), %rdi
callq 0x88530
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xac540
movl %eax, -0x14(%rbp)
leaq 0xee759(%rip), %rax     # 0x1781d8
cmpl $0x0, 0xa00(%rax)
jne 0x89aa6
movq -0x10(%rbp), %rdi
leaq 0xba0b4(%rip), %rsi     # 0x143b47
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x89b21
cmpl $0x1, -0x14(%rbp)
je 0x89aca
movq -0x10(%rbp), %rdi
leaq 0xba108(%rip), %rsi     # 0x143bbf
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x89b21
jmp 0x89acc
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xace10
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $-0x4, %eax
cmpl $0x0, %eax
je 0x89b0a
movq -0x10(%rbp), %rdi
leaq 0xba0f1(%rip), %rsi     # 0x143be8
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x89b21
movl -0x18(%rbp), %ecx
leaq 0xee6c4(%rip), %rax     # 0x1781d8
movl %ecx, 0xa08(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xac540
movl %eax, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jge 0x89b6f
movq -0x10(%rbp), %rdi
leaq 0xba0db(%rip), %rsi     # 0x143c34
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x89c7c
movq -0x10(%rbp), %rdi
xorl %esi, %esi
subl -0x18(%rbp), %esi
callq 0xacb80
cmpl $0x0, %eax
jne 0x89ba3
movq -0x10(%rbp), %rdi
leaq 0xba0d3(%rip), %rsi     # 0x143c60
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x89c7c
jmp 0x89ba5
movq -0x10(%rbp), %rdi
xorl %esi, %esi
subl -0x18(%rbp), %esi
callq 0xace10
cvttsd2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x89bc6
cmpl $0x3, -0x1c(%rbp)
jle 0x89be7
movq -0x10(%rbp), %rdi
leaq 0xba0bc(%rip), %rsi     # 0x143c8d
callq 0xad410
movq -0x10(%rbp), %rdi
callq 0xae670
movl %eax, -0x4(%rbp)
jmp 0x89c7c
callq 0x384f0
movq %rax, -0x28(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x89c60
movq -0x10(%rbp), %rdi
xorl %esi, %esi
subl -0x18(%rbp), %esi
addl -0x14(%rbp), %esi
leaq -0x30(%rbp), %rdx
callq 0xacf60
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x89c53
cmpl $0x1, -0x14(%rbp)
je 0x89c3e
movq -0x28(%rbp), %rdi
leaq 0xb5519(%rip), %rsi     # 0x13f149
movl $0x1, %edx
callq 0x39040
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x39040
movq %rax, -0x28(%rbp)
jmp 0x89c55
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x89bf7
movl -0x1c(%rbp), %edi
movq -0x28(%rbp), %rsi
callq 0x2fa20
movq -0x28(%rbp), %rdi
callq 0x38620
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb191b(%rip), %rsi     # 0x13b612
leaq 0x37dd2(%rip), %rdx     # 0xc1ad0
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xad62a(%rip), %rsi     # 0x137338
leaq 0x3b51b(%rip), %rdx     # 0xc5230
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xc106a(%rip), %rsi     # 0x14ad8f
leaq 0x3c0a4(%rip), %rdx     # 0xc5dd0
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xb9f66(%rip), %rsi     # 0x143ca2
leaq 0x3aa6d(%rip), %rdx     # 0xc47b0
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xc3d92(%rip), %rsi     # 0x14dae5
leaq 0x39876(%rip), %rdx     # 0xc35d0
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xb9f3d(%rip), %rsi     # 0x143ca7
leaq 0x3ed1f(%rip), %rdx     # 0xc8a90
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xb9f2c(%rip), %rsi     # 0x143cad
leaq 0x412d8(%rip), %rdx     # 0xcb060
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xb9f1c(%rip), %rsi     # 0x143cb4
leaq 0x44431(%rip), %rdx     # 0xce1d0
callq 0x89c90
movq -0x8(%rbp), %rdi
leaq 0xc2543(%rip), %rsi     # 0x14c2f2
leaq 0x4452a(%rip), %rdx     # 0xce2e0
callq 0x89c90
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xad2c0
movq -0x8(%rbp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0xb9ec8(%rip), %rdx     # 0x143cbd
callq 0xadca0
movq -0x8(%rbp), %rdi
callq 0xad2c0
movq -0x8(%rbp), %rdi
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
leaq 0xb9eb3(%rip), %rdx     # 0x143cc6
callq 0xadca0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
movl $0xffffffff, 0x102402(%rip) # imm = 0xFFFFFFFF
movl $0x0, 0x1023fc(%rip)    # 0x18cb94
callq 0x26e20
movq %rax, 0x1023fc(%rip)    # 0x18cba0
movq 0x1023f5(%rip), %rax    # 0x18cba0
leaq -0x52192(%rip), %rcx    # 0x38620
movq %rcx, 0x18(%rax)
callq 0x26e20
movq %rax, 0x1023ee(%rip)    # 0x18cbb0
movq $0x0, 0x1024fb(%rip) # 0x18ccc8
movl $0x0, 0x1024f9(%rip)    # 0x18ccd0
callq 0x384f0
movq %rax, 0x1024f5(%rip)    # 0x18ccd8
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0xad9e0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x8aac3
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
callq 0x895c0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq %rax, %rdx
callq 0xad390
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %edx
addl $0x1, %edx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xade10
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x8aa5b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0xadca0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2ff70
leaq 0xed4bc(%rip), %rcx     # 0x1781d8
subq 0x9f0(%rcx), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
leaq 0xed4a6(%rip), %rcx     # 0x1781d8
cmpq 0x9e8(%rcx), %rax
jl 0x8ad99
leaq 0xed496(%rip), %rax     # 0x1781d8
cmpl $0x0, 0xa0c(%rax)
jne 0x8ad99
movq -0x18(%rbp), %rdx
movl $0x3, %edi
leaq 0xb9460(%rip), %rsi     # 0x1441bb
movb $0x0, %al
callq 0x2fc60
leaq 0xed46f(%rip), %rax     # 0x1781d8
movl $0x1, 0xa0c(%rax)
leaq 0xed45e(%rip), %rax     # 0x1781d8
movq 0x40(%rax), %rdi
leaq 0xed453(%rip), %rax     # 0x1781d8
movq 0x9d8(%rax), %rax
movl 0x8(%rax), %esi
movl $0x1, %edx
callq 0x2aab0
leaq 0xed438(%rip), %rax     # 0x1781d8
cmpl $0x0, 0xa0c(%rax)
je 0x8adae
callq 0x46e80
leaq 0xed423(%rip), %rax     # 0x1781d8
cmpl $0x0, 0xa10(%rax)
je 0x8adea
movl $0x3, %edi
leaq 0xb9475(%rip), %rsi     # 0x14423f
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rdi
leaq 0xb948f(%rip), %rsi     # 0x14426b
callq 0xad410
movq -0x8(%rbp), %rdi
callq 0xae670
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: evalCommand
void evalCommand(client *c) {
    if (!(c->flags & CLIENT_LUA_DEBUG))
        evalGenericCommand(c,0);
    else
        evalGenericCommandWithDebugging(c,0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x2000000, %eax        # imm = 0x2000000
cmpl $0x0, %eax
jne 0x8b72d
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x8adf0
jmp 0x8b738
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x8b740
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8bf50
cmpl $0x0, %eax
je 0x8b774
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x8adf0
movq -0x8(%rbp), %rdi
callq 0x8c1d0
jmp 0x8b77d
movq -0x8(%rbp), %rdi
callq 0x8bca0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x895c0
cmpq $0x28, %rax
je 0x8b7d0
movq -0x8(%rbp), %rdi
leaq 0xed47e(%rip), %rax     # 0x178c40
movq 0x98(%rax), %rsi
callq 0x42cc0
jmp 0x8b804
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x2000000, %eax        # imm = 0x2000000
cmpl $0x0, %eax
jne 0x8b7f4
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x8adf0
jmp 0x8b804
movq -0x8(%rbp), %rdi
leaq 0xb8b5e(%rip), %rsi     # 0x14435d
callq 0x42f90
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
orl $0x2000000, %ecx        # imm = 0x2000000
movl %ecx, 0x98(%rax)
movq 0x100eb7(%rip), %rdi    # 0x18cba0
callq 0x8bd50
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x100e95(%rip)    # 0x18cb90
movl $0x1, 0x100fb7(%rip)    # 0x18ccbc
movl $0x0, 0x100fa9(%rip)    # 0x18ccb8
movl $0x0, 0x100fa7(%rip)    # 0x18ccc0
movq 0x100fb8(%rip), %rdi    # 0x18ccd8
callq 0x38620
callq 0x384f0
movq %rax, 0x100fa7(%rip)    # 0x18ccd8
movq $0x100, 0x100fa4(%rip) # imm = 0x100
movl $0x0, 0x100fa2(%rip)    # 0x18cce8
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpq $0x0, 0x100f35(%rip)    # 0x18cce0
je 0x8bdf7
movq -0x8(%rbp), %rdi
callq 0x895c0
cmpq 0x100f23(%rip), %rax    # 0x18cce0
jbe 0x8bdf7
movq -0x8(%rbp), %rdi
movq 0x100f16(%rip), %rax    # 0x18cce0
subq $0x1, %rax
movl %eax, %edx
xorl %esi, %esi
callq 0x39db0
movq -0x8(%rbp), %rdi
leaq 0xb871d(%rip), %rsi     # 0x1444ff
movl $0x4, %edx
callq 0x39040
movq %rax, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x88530
cmpl $0x0, -0xc(%rbp)
je 0x8be2d
cmpl $0x0, 0x100edb(%rip)    # 0x18cce8
jne 0x8be2d
movl $0x1, 0x100ecf(%rip)    # 0x18cce8
leaq 0xb86e4(%rip), %rdi     # 0x144504
callq 0x38510
movq %rax, %rdi
callq 0x88530
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x384f0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq 0x100d44(%rip), %rax    # 0x18cba0
movq 0x28(%rax), %rax
movl %eax, %edx
leaq 0xb86e3(%rip), %rsi     # 0x14454c
movb $0x0, %al
callq 0x39660
movq %rax, -0x8(%rbp)
movq 0x100d25(%rip), %rax    # 0x18cba0
cmpq $0x0, 0x28(%rax)
je 0x8bf10
movq 0x100d13(%rip), %rax    # 0x18cba0
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xac0e3(%rip), %rsi     # 0x137f82
movl $0x1, %edx
callq 0x39040
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xb23cc(%rip), %rsi     # 0x13e288
leaq 0xb87b8(%rip), %rdx     # 0x14467b
movl $0x2, %ecx
callq 0x3aa80
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x39110
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb239b(%rip), %rsi     # 0x13e288
movl $0x2, %edx
callq 0x39040
movq %rax, -0x8(%rbp)
movq 0x100c9e(%rip), %rdi    # 0x18cba0
movq -0x10(%rbp), %rsi
callq 0x271e0
jmp 0x8be74
movl 0x100c7a(%rip), %eax    # 0x18cb90
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x895c0
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rsi
movq %rax, %rdx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x8bf41
jmp 0x8bf41
movq -0x8(%rbp), %rdi
callq 0x38620
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xb83f1(%rip), %rdi     # 0x1445d4
callq 0x38510
movq %rax, %rdi
callq 0x88530
callq 0x8be40
cmpl $0x0, 0x10099c(%rip)    # 0x18cb98
je 0x8c22c
movq -0x8(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x8(%rbp), %rsi
xorl %edx, %edx
callq 0x44550
movl $0x3, %edi
leaq 0xb83c5(%rip), %rsi     # 0x1445e1
movb $0x0, %al
callq 0x2fc60
xorl %edi, %edi
callq 0x2ff90
jmp 0x8c23f
movl $0x3, %edi
leaq 0xb83cd(%rip), %rsi     # 0x144605
movb $0x0, %al
callq 0x2fc60
movl 0x10094b(%rip), %esi    # 0x18cb90
xorl %eax, %eax
movl %eax, %edi
callq 0x2b860
movl 0x10093c(%rip), %esi    # 0x18cb90
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rdi
callq 0x2bc40
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x98(%rax)
movq 0x100a4e(%rip), %rdi    # 0x18ccc8
movl 0x100a50(%rip), %esi    # 0x18ccd0
callq 0x3a270
movl $0x0, 0x100a41(%rip)    # 0x18ccd0
movl $0x0, 0x1008fb(%rip)    # 0x18cb94
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movq 0x1008fe(%rip), %rdi    # 0x18cbb0
movslq -0x8(%rbp), %rsi
callq 0x274d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x8c2df
movq 0x1008e3(%rip), %rdi    # 0x18cbb0
movq -0x10(%rbp), %rsi
callq 0x271e0
movl $0x1, -0x4(%rbp)
jmp 0x8c2e6
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x100891(%rip), %rdi    # 0x18cbb0
leaq -0x10(%rbp), %rsi
callq 0x27320
leaq -0x10(%rbp), %rdi
callq 0x27380
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x8c36c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rdx
movl $0x3, %edi
leaq 0xb82de(%rip), %rsi     # 0x144634
movb $0x0, %al
callq 0x2fc60
movl -0x1c(%rbp), %edi
movl $0x9, %esi
callq 0x26670
jmp 0x8c328
movq 0x10083d(%rip), %rdi    # 0x18cbb0
callq 0x26ea0
callq 0x26e20
movq %rax, 0x10082c(%rip)    # 0x18cbb0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x1008c1(%rip), %eax    # 0x18ccb8
jge 0x8c423
movslq -0xc(%rbp), %rcx
leaq 0x10078c(%rip), %rax    # 0x18cb90
movl 0x28(%rax,%rcx,4), %eax
cmpl -0x8(%rbp), %eax
jne 0x8c416
movl $0x1, -0x4(%rbp)
jmp 0x8c42a
jmp 0x8c418
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8c3ee
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jle 0x8c44c
movl -0x8(%rbp), %eax
cmpl 0x100886(%rip), %eax    # 0x18ccd0
jle 0x8c455
movl $0x0, -0x4(%rbp)
jmp 0x8c49d
movl -0x8(%rbp), %edi
callq 0x8c3e0
cmpl $0x0, %eax
jne 0x8c496
cmpl $0x40, 0x10084f(%rip)   # 0x18ccb8
je 0x8c496
movl -0x8(%rbp), %edx
movl 0x100844(%rip), %eax    # 0x18ccb8
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x100839(%rip)    # 0x18ccb8
movslq %eax, %rcx
leaq 0x100707(%rip), %rax    # 0x18cb90
movl %edx, 0x28(%rax,%rcx,4)
movl $0x1, -0x4(%rbp)
jmp 0x8c49d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x1007ed(%rip), %eax    # 0x18ccb8
jge 0x8c54a
movslq -0xc(%rbp), %rcx
leaq 0x1006b8(%rip), %rax    # 0x18cb90
movl 0x28(%rax,%rcx,4), %eax
cmpl -0x8(%rbp), %eax
jne 0x8c53a
movl 0x1007d1(%rip), %eax    # 0x18ccb8
addl $-0x1, %eax
movl %eax, 0x1007c8(%rip)    # 0x18ccb8
movslq -0xc(%rbp), %rax
leaq 0x100695(%rip), %rdi    # 0x18cb90
addq $0x28, %rdi
shlq $0x2, %rax
addq %rax, %rdi
movslq -0xc(%rbp), %rax
leaq 0x10067f(%rip), %rsi    # 0x18cb90
addq $0x28, %rsi
shlq $0x2, %rax
addq %rax, %rsi
addq $0x4, %rsi
movl 0x100792(%rip), %eax    # 0x18ccb8
subl -0xc(%rbp), %eax
movslq %eax, %rdx
callq 0x267e0
movl $0x1, -0x4(%rbp)
jmp 0x8c551
jmp 0x8c53c
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8c4c2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x8c390
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %edi
callq 0x8c3e0
movl %eax, -0x1c(%rbp)
movl 0x10053c(%rip), %eax    # 0x18ccd4
cmpl -0x4(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x8c7bf
cmpl $0x0, -0x1c(%rbp)
je 0x8c7bf
leaq 0xb7eb9(%rip), %rax     # 0x144672
movq %rax, -0x18(%rbp)
jmp 0x8c7f4
cmpl $0x0, -0x20(%rbp)
je 0x8c7d2
leaq 0xb0957(%rip), %rax     # 0x13d123
movq %rax, -0x18(%rbp)
jmp 0x8c7f2
cmpl $0x0, -0x1c(%rbp)
je 0x8c7e5
leaq 0xb7e97(%rip), %rax     # 0x144676
movq %rax, -0x18(%rbp)
jmp 0x8c7f0
leaq 0xb7e8e(%rip), %rax     # 0x14467a
movq %rax, -0x18(%rbp)
jmp 0x8c7f2
jmp 0x8c7f4
callq 0x384f0
movq %rax, %rdi
movq -0x18(%rbp), %rdx
movl -0x4(%rbp), %ecx
movq -0x10(%rbp), %r8
leaq 0xb7e70(%rip), %rsi     # 0x14467e
movb $0x0, %al
callq 0x395b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x88530
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x100482(%rip), %eax    # 0x18ccd0
jg 0x8c87d
cmpl $0x0, -0x4(%rbp)
je 0x8c86a
movl -0x4(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl -0x8(%rbp), %eax
jle 0x8c86a
jmp 0x8c872
movl -0xc(%rbp), %edi
callq 0x8c770
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8c845
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
addl $-0x24, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x16, %eax
ja 0x8cd6e
movq -0x20(%rbp), %rax
leaq 0xb6ae0(%rip), %rcx     # 0x1437e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8cd80
movq %rax, -0x18(%rbp)
jmp 0x8cd6e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8cdf0
movq %rax, -0x18(%rbp)
jmp 0x8cd6e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8ceb0
movq %rax, -0x18(%rbp)
jmp 0x8cd6e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8ceb0
movq %rax, -0x18(%rbp)
jmp 0x8cd6e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8cf10
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
subq %rax, %rsi
subq $0x1, %rsi
leaq -0x28(%rbp), %rdx
callq 0x47970
cmpq $-0x1, -0x28(%rbp)
jne 0x8ce6d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xb0ed4(%rip), %rsi     # 0x13dd1f
movl $0x4, %edx
callq 0x39040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
jmp 0x8cea3
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
movq -0x28(%rbp), %rdx
callq 0x3a2c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
addq $0x2, %rax
addq -0x28(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movl $0xd, %esi
callq 0x267f0
movq %rax, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1, %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
subq %rax, %rsi
subq $0x1, %rsi
leaq -0x28(%rbp), %rdx
callq 0x47970
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
cmpq $-0x1, -0x28(%rbp)
jne 0x8cf9f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xb0da1(%rip), %rsi     # 0x13dd1f
movl $0x4, %edx
callq 0x39040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8d04d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xb7714(%rip), %rsi     # 0x1446c1
movl $0x1, %edx
callq 0x39040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x8d023
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x8ccd0
movq %rax, -0x20(%rbp)
movslq -0x2c(%rbp), %rax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x8d016
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xb6468(%rip), %rsi     # 0x14346a
movl $0x1, %edx
callq 0x39040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x8d018
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x8cfc8
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xbd3d1(%rip), %rsi     # 0x14a402
movl $0x1, %edx
callq 0x39040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x8c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x8c(%rbp), %esi
leaq -0x88(%rbp), %rdx
callq 0xaec40
cmpl $0x0, %eax
je 0x8d134
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
movl $0x1, -0x9c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x9c(%rbp), %edx
leaq -0x88(%rbp), %rsi
callq 0xaed30
movq %rax, -0x98(%rbp)
cmpq $0x0, %rax
je 0x8d12f
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x98(%rbp), %rsi
callq 0x268f0
cmpl $0x0, %eax
jne 0x8d11f
movq -0x8(%rbp), %rdi
leaq 0xb75ff(%rip), %rsi     # 0x144706
callq 0x8cc80
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xac570
jmp 0x8d1a4
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xac570
jmp 0x8d0b5
jmp 0x8d07d
movq -0x10(%rbp), %rdi
leaq 0xb71d9(%rip), %rsi     # 0x144318
callq 0x268f0
cmpl $0x0, %eax
je 0x8d15e
movq -0x10(%rbp), %rdi
leaq 0xb71bf(%rip), %rsi     # 0x144313
callq 0x268f0
cmpl $0x0, %eax
jne 0x8d190
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0xad850
movq -0x8(%rbp), %rdi
leaq 0xb758b(%rip), %rsi     # 0x144706
callq 0x8cc80
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xac570
jmp 0x8d1a4
leaq 0xb7578(%rip), %rdi     # 0x14470f
callq 0x38510
movq %rax, %rdi
callq 0x88530
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x84(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq -0x80(%rbp), %rdx
callq 0xaec40
cmpl $0x0, %eax
je 0x8d29b
movl $0x1, -0x94(%rbp)
movq -0x8(%rbp), %rdi
movl -0x94(%rbp), %edx
leaq -0x80(%rbp), %rsi
callq 0xaed30
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
je 0x8d299
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
movq -0x90(%rbp), %rdi
leaq 0xb74f5(%rip), %rsi     # 0x144721
callq 0x266c0
cmpq $0x0, %rax
jne 0x8d286
callq 0x384f0
movq %rax, %rdi
movq -0x90(%rbp), %rdx
leaq 0xb74e1(%rip), %rsi     # 0x14472e
movb $0x0, %al
callq 0x395b0
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x8cc80
movq -0xa0(%rbp), %rdi
callq 0x38620
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xac570
jmp 0x8d1eb
jmp 0x8d29b
cmpl $0x0, -0x84(%rbp)
jne 0x8d2b8
leaq 0xb7491(%rip), %rdi     # 0x14473c
callq 0x38510
movq %rax, %rdi
callq 0x88530
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)