// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x52a51(%rip), %rdx     # 0xc7c31
movl $0x1, %ecx
callq 0x3b20a
movq %rax, %r14
leaq 0x58693(%rip), %rdi     # 0xcd887
callq 0x39245
movq %rax, %rdi
movq %r14, %rsi
callq 0x39b4d
movq %rax, %r15
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x75244
leaq 0x57618(%rip), %rcx     # 0xcc834
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x75246
movq -0x11(%r15), %rdx
jmp 0x75246
movzwl -0x5(%r15), %edx
jmp 0x75246
movl -0x9(%r15), %edx
jmp 0x75246
movzbl -0x3(%r15), %edx
jmp 0x75246
xorl %edx, %edx
leaq 0x58642(%rip), %rcx     # 0xcd88f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9558c
testl %eax, %eax
je 0x75317
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x89976
movzbl -0x1(%r14), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x752ab
leaq 0x575c5(%rip), %rcx     # 0xcc848
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x752ad
movq -0x11(%r14), %rdx
jmp 0x752ad
movzwl -0x5(%r14), %edx
jmp 0x752ad
movl -0x9(%r14), %edx
jmp 0x752ad
movzbl -0x3(%r14), %edx
jmp 0x752ad
xorl %edx, %edx
leaq 0x585db(%rip), %rcx     # 0xcd88f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9558c
testl %eax, %eax
je 0x75317
callq 0x39222
movq %rax, %r15
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x89e02
leaq 0x575c7(%rip), %rsi     # 0xcc8a8
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x39f3b
movq 0xa5f1b(%rip), %rdi     # 0x11b210
movq %rax, %rsi
callq 0x2e40f
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x89976
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x392b6
movq %r14, %rdi
callq 0x392b6
movq %r15, %rdi
callq 0x392b6
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x8a6ac
testl %eax, %eax
je 0x75378
callq 0x39222
movq %rax, %r14
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x89e02
leaq 0x5754e(%rip), %rsi     # 0xcc8a8
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x39f3b
movq 0xa5ea2(%rip), %rdi     # 0x11b210
movq %rax, %rsi
callq 0x2e40f
jmp 0x75387
leaq 0x5851a(%rip), %rsi     # 0xcd899
movq %rbx, %rdi
callq 0x74aee
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
popq %rbx
popq %r14
popq %r15
jmp 0x89976