// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/scripting.c
// Function: scriptCommand
void scriptCommand(client *c) {
    if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"flush")) {
        scriptingReset();
        addReply(c,shared.ok);
        replicationScriptCacheFlush();
        server.dirty++; /* Propagating this command is a good idea. */
    } else if (c->argc >= 2 && !strcasecmp(c->argv[1]->ptr,"exists")) {
        int j;

        addReplyMultiBulkLen(c, c->argc-2);
        for (j = 2; j < c->argc; j++) {
            if (dictFind(server.lua_scripts,c->argv[j]->ptr))
                addReply(c,shared.cone);
            else
                addReply(c,shared.czero);
        }
    } else if (c->argc == 3 && !strcasecmp(c->argv[1]->ptr,"load")) {
        char funcname[43];
        sds sha;

        funcname[0] = 'f';
        funcname[1] = '_';
        sha1hex(funcname+2,c->argv[2]->ptr,sdslen(c->argv[2]->ptr));
        sha = sdsnewlen(funcname+2,40);
        if (dictFind(server.lua_scripts,sha) == NULL) {
            if (luaCreateFunction(c,server.lua,funcname,c->argv[2])
                    == C_ERR) {
                sdsfree(sha);
                return;
            }
        }
        addReplyBulkCBuffer(c,funcname+2,40);
        sdsfree(sha);
        forceCommandPropagation(c,PROPAGATE_REPL|PROPAGATE_AOF);
    } else if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"kill")) {
        if (server.lua_caller == NULL) {
            addReplySds(c,sdsnew("-NOTBUSY No scripts in execution right now.\r\n"));
        } else if (server.lua_write_dirty) {
            addReplySds(c,sdsnew("-UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.\r\n"));
        } else {
            server.lua_kill = 1;
            addReply(c,shared.ok);
        }
    } else if (c->argc == 3 && !strcasecmp(c->argv[1]->ptr,"debug")) {
        if (clientHasPendingReplies(c)) {
            addReplyError(c,"SCRIPT DEBUG must be called outside a pipeline");
            return;
        }
        if (!strcasecmp(c->argv[2]->ptr,"no")) {
            ldbDisable(c);
            addReply(c,shared.ok);
        } else if (!strcasecmp(c->argv[2]->ptr,"yes")) {
            ldbEnable(c);
            addReply(c,shared.ok);
        } else if (!strcasecmp(c->argv[2]->ptr,"sync")) {
            ldbEnable(c);
            addReply(c,shared.ok);
            c->flags |= CLIENT_LUA_DEBUG_SYNC;
        } else {
            addReplyError(c,"Use SCRIPT DEBUG yes/sync/no");
        }
    } else {
        addReplyError(c, "Unknown SCRIPT subcommand or wrong # of args.");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x8b88a
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb8b51(%rip), %rsi     # 0x14438e
callq 0x26300
cmpl $0x0, %eax
jne 0x8b88a
callq 0x8aa10
movq -0x8(%rbp), %rdi
leaq 0xed3e9(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
callq 0x4eaf0
leaq 0xec96c(%rip), %rax     # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0xec95a(%rip), %rax     # 0x1781d8
movq %rcx, 0x720(%rax)
jmp 0x8bc91
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jl 0x8b94f
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3158(%rip), %rsi     # 0x13ea07
callq 0x26300
cmpl $0x0, %eax
jne 0x8b94f
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x437f0
movl $0x2, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x8b94a
leaq 0xec8eb(%rip), %rax     # 0x1781d8
movq 0x9e0(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rsi
callq 0x2dcb0
cmpq $0x0, %rax
je 0x8b929
movq -0x8(%rbp), %rdi
leaq 0xed322(%rip), %rax     # 0x178c40
movq 0x28(%rax), %rsi
callq 0x42cc0
jmp 0x8b93d
movq -0x8(%rbp), %rdi
leaq 0xed30c(%rip), %rax     # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x8b93f
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8b8da
jmp 0x8bc8f
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jne 0x8ba70
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb5015(%rip), %rsi     # 0x140989
callq 0x26300
cmpl $0x0, %eax
jne 0x8ba70
movb $0x66, -0x40(%rbp)
movb $0x5f, -0x3f(%rbp)
leaq -0x40(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x895c0
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
callq 0x87f70
leaq -0x40(%rbp), %rdi
addq $0x2, %rdi
movl $0x28, %esi
callq 0x38230
movq %rax, -0x48(%rbp)
leaq 0xec7ec(%rip), %rax     # 0x1781d8
movq 0x9e0(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x2dcb0
cmpq $0x0, %rax
jne 0x8ba3e
movq -0x8(%rbp), %rdi
leaq 0xec7cb(%rip), %rax     # 0x1781d8
movq 0x9c8(%rax), %rsi
leaq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rcx
callq 0x8aae0
cmpl $-0x1, %eax
jne 0x8ba3c
movq -0x48(%rbp), %rdi
callq 0x38620
jmp 0x8bc91
jmp 0x8ba3e
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
addq $0x2, %rsi
movl $0x28, %edx
callq 0x43920
movq -0x48(%rbp), %rdi
callq 0x38620
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x33ca0
jmp 0x8bc8d
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jne 0x8bb34
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xaf33b(%rip), %rsi     # 0x13add0
callq 0x26300
cmpl $0x0, %eax
jne 0x8bb34
leaq 0xec72e(%rip), %rax     # 0x1781d8
cmpq $0x0, 0x9d8(%rax)
jne 0x8bad6
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0xb88d1(%rip), %rdi     # 0x144394
callq 0x38510
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x8bb2f
leaq 0xec6fb(%rip), %rax     # 0x1781d8
cmpl $0x0, 0x9f8(%rax)
je 0x8bb08
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0xb88cd(%rip), %rdi     # 0x1443c2
callq 0x38510
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x8bb2d
leaq 0xec6c9(%rip), %rax     # 0x1781d8
movl $0x1, 0xa10(%rax)
movq -0x8(%rbp), %rdi
leaq 0xed11c(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x8bb2f
jmp 0x8bc8b
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jne 0x8bc79
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xc1f8c(%rip), %rsi     # 0x14dae5
callq 0x26300
cmpl $0x0, %eax
jne 0x8bc79
movq -0x8(%rbp), %rdi
callq 0x424d0
cmpl $0x0, %eax
je 0x8bb8a
movq -0x8(%rbp), %rdi
leaq 0xb8905(%rip), %rsi     # 0x144485
callq 0x42f90
jmp 0x8bc91
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb892d(%rip), %rsi     # 0x1444ce
callq 0x26300
cmpl $0x0, %eax
jne 0x8bbcd
movq -0x8(%rbp), %rdi
callq 0x8bca0
movq -0x8(%rbp), %rdi
leaq 0xed081(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x8bc77
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xaf211(%rip), %rsi     # 0x13adf5
callq 0x26300
cmpl $0x0, %eax
jne 0x8bc0d
movq -0x8(%rbp), %rdi
callq 0x8bcc0
movq -0x8(%rbp), %rdi
leaq 0xed03e(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x8bc75
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb91cc(%rip), %rsi     # 0x144df0
callq 0x26300
cmpl $0x0, %eax
jne 0x8bc63
movq -0x8(%rbp), %rdi
callq 0x8bcc0
movq -0x8(%rbp), %rdi
leaq 0xecffe(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rax
movl 0x98(%rax), %ecx
orl $0x4000000, %ecx        # imm = 0x4000000
movl %ecx, 0x98(%rax)
jmp 0x8bc73
movq -0x8(%rbp), %rdi
leaq 0xb8846(%rip), %rsi     # 0x1444b4
callq 0x42f90
jmp 0x8bc75
jmp 0x8bc77
jmp 0x8bc89
movq -0x8(%rbp), %rdi
leaq 0xb884d(%rip), %rsi     # 0x1444d1
callq 0x42f90
jmp 0x8bc8b
jmp 0x8bc8d
jmp 0x8bc8f
jmp 0x8bc91
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)