// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x107e75(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x31c(%rax)
je 0x703a2
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xc7362(%rip), %rsi     # 0x1376e5
callq 0x26300
cmpl $0x0, %eax
je 0x703a2
movq -0x8(%rbp), %rdi
leaq 0xcee30(%rip), %rsi     # 0x13f1c8
callq 0x42f90
jmp 0x7058d
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xc847c(%rip), %rsi     # 0x138835
callq 0x26300
cmpl $0x0, %eax
jne 0x703e0
movq -0x8(%rbp), %rax
cmpl $0x4, 0x38(%rax)
je 0x703d2
jmp 0x7056b
movq -0x8(%rbp), %rdi
callq 0x6aa00
jmp 0x70569
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xc72ee(%rip), %rsi     # 0x1376e5
callq 0x26300
cmpl $0x0, %eax
jne 0x7041e
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x70410
jmp 0x7056b
movq -0x8(%rbp), %rdi
callq 0x6c5f0
jmp 0x70567
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xcedbd(%rip), %rsi     # 0x13f1f2
callq 0x26300
cmpl $0x0, %eax
jne 0x70471
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
je 0x7044e
jmp 0x7056b
callq 0x33030
callq 0x33940
movq -0x8(%rbp), %rdi
leaq 0x1087dd(%rip), %rax    # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x70565
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xce384(%rip), %rsi     # 0x13e80c
callq 0x26300
cmpl $0x0, %eax
jne 0x70553
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
je 0x704a5
jmp 0x7056b
leaq 0x107d2c(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x8(%rax)
jne 0x704c8
movq -0x8(%rbp), %rdi
leaq 0xced3e(%rip), %rsi     # 0x13f1fc
callq 0x42f90
jmp 0x7058d
leaq 0x107d09(%rip), %rax    # 0x1781d8
movq 0x8(%rax), %rdi
callq 0x6f960
cmpl $-0x1, %eax
jne 0x7052a
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq %rax, %rdx
movl $0x3, %edi
leaq 0xced30(%rip), %rsi     # 0x13f228
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq -0x10(%rbp), %rdi
movq %rax, %rdx
leaq 0xced21(%rip), %rsi     # 0x13f242
movb $0x0, %al
callq 0x42fd0
jmp 0x70551
movl $0x3, %edi
leaq 0xced26(%rip), %rsi     # 0x13f25c
movb $0x0, %al
callq 0x2fc60
movq -0x8(%rbp), %rdi
leaq 0x1086f8(%rip), %rax    # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x70563
movq -0x8(%rbp), %rdi
leaq 0xced24(%rip), %rsi     # 0x13f282
callq 0x42f90
jmp 0x70565
jmp 0x70567
jmp 0x70569
jmp 0x7058d
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0xced3a(%rip), %rsi     # 0x13f2c0
movb $0x0, %al
callq 0x42fd0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)