// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/config.c
// Function: configCommand
void configCommand(client *c) {
    /* Only allow CONFIG GET while loading. */
    if (server.loading && strcasecmp(c->argv[1]->ptr,"get")) {
        addReplyError(c,"Only CONFIG GET is allowed during loading");
        return;
    }

    if (!strcasecmp(c->argv[1]->ptr,"set")) {
        if (c->argc != 4) goto badarity;
        configSetCommand(c);
    } else if (!strcasecmp(c->argv[1]->ptr,"get")) {
        if (c->argc != 3) goto badarity;
        configGetCommand(c);
    } else if (!strcasecmp(c->argv[1]->ptr,"resetstat")) {
        if (c->argc != 2) goto badarity;
        resetServerStats();
        resetCommandTableStats();
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"rewrite")) {
        if (c->argc != 2) goto badarity;
        if (server.configfile == NULL) {
            addReplyError(c,"The server is running without a config file");
            return;
        }
        if (rewriteConfig(server.configfile) == -1) {
            serverLog(LL_WARNING,"CONFIG REWRITE failed: %s", strerror(errno));
            addReplyErrorFormat(c,"Rewriting config file: %s", strerror(errno));
        } else {
            serverLog(LL_WARNING,"CONFIG REWRITE executed with success.");
            addReply(c,shared.ok);
        }
    } else {
        addReplyError(c,
            "CONFIG subcommand must be one of GET, SET, RESETSTAT, REWRITE");
    }
    return;

badarity:
    addReplyErrorFormat(c,"Wrong number of arguments for CONFIG %s",
        (char*) c->argv[1]->ptr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xa4d26(%rip), %r15     # 0x1018a8
cmpl $0x0, 0x31c(%r15)
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r14
je 0x5cbc2
leaq 0x5fbd3(%rip), %rsi     # 0xbc775
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x5cbc2
leaq 0x68167(%rip), %rsi     # 0xc4d1c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3cc06
leaq 0x60cfc(%rip), %rsi     # 0xbd8c5
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x5cc17
leaq 0x5fb99(%rip), %rsi     # 0xbc775
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x5cc2a
leaq 0x68157(%rip), %rsi     # 0xc4d46
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x5cc3d
leaq 0x6775e(%rip), %rsi     # 0xc4360
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x5cc65
leaq 0x681c1(%rip), %rsi     # 0xc4dd6
jmp 0x5cbb5
cmpl $0x4, 0x38(%rbx)
jne 0x5cc93
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x586a5
cmpl $0x3, 0x38(%rbx)
jne 0x5cc93
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x59bf5
cmpl $0x2, 0x38(%rbx)
jne 0x5cc93
callq 0x32562
callq 0x32c3f
leaq 0xa56bc(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3c854
cmpl $0x2, 0x38(%rbx)
jne 0x5cc93
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x5ccac
callq 0x5c3c8
cmpl $-0x1, %eax
je 0x5ccb8
leaq 0x6812b(%rip), %rsi     # 0xc4db0
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
jmp 0x5cc4d
leaq 0x6817a(%rip), %rsi     # 0xc4e14
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x3cc2d
leaq 0x6809d(%rip), %rsi     # 0xc4d50
jmp 0x5cbb5
callq 0x26880
movq %rax, %r14
movl (%rax), %edi
callq 0x26680
leaq 0x680ae(%rip), %rsi     # 0xc4d7c
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movl (%r14), %edi
callq 0x26680
leaq 0x680aa(%rip), %rsi     # 0xc4d96
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x5cca0