// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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
movq %rdi, %rbx
leaq 0xa60c2(%rip), %r15     # 0x106858
cmpl $0x0, 0x31c(%r15)
je 0x607d0
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x5ef72(%rip), %rsi     # 0xbf725
callq 0x26300
testl %eax, %eax
je 0x607d0
leaq 0x674ed(%rip), %rsi     # 0xc7cb0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3ffcb
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r14
leaq 0x60070(%rip), %rsi     # 0xc0853
movq %r14, %rdi
callq 0x26300
testl %eax, %eax
je 0x60831
leaq 0x5ef2f(%rip), %rsi     # 0xbf725
movq %r14, %rdi
callq 0x26300
testl %eax, %eax
je 0x60844
leaq 0x674d1(%rip), %rsi     # 0xc7cda
movq %r14, %rdi
callq 0x26300
testl %eax, %eax
je 0x60857
leaq 0x66ad8(%rip), %rsi     # 0xc72f4
movq %r14, %rdi
callq 0x26300
testl %eax, %eax
je 0x6087f
leaq 0x6753b(%rip), %rsi     # 0xc7d6a
jmp 0x607c3
cmpl $0x4, 0x38(%rbx)
jne 0x608ad
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5c202
cmpl $0x3, 0x38(%rbx)
jne 0x608ad
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5d84e
cmpl $0x2, 0x38(%rbx)
jne 0x608ad
callq 0x355e8
callq 0x35cc5
leaq 0xa6a42(%rip), %rax     # 0x1072b0
movq 0x8(%rax), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3fc19
cmpl $0x2, 0x38(%rbx)
jne 0x608ad
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x608c6
callq 0x5ffd9
cmpl $-0x1, %eax
je 0x608d2
leaq 0x674a5(%rip), %rsi     # 0xc7d44
movl $0x3, %edi
xorl %eax, %eax
callq 0x32ea6
jmp 0x60867
leaq 0x674f4(%rip), %rsi     # 0xc7da8
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x3fff2
leaq 0x67417(%rip), %rsi     # 0xc7ce4
jmp 0x607c3
callq 0x26890
movq %rax, %r14
movl (%rax), %edi
callq 0x26690
leaq 0x67428(%rip), %rsi     # 0xc7d10
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x32ea6
movl (%r14), %edi
callq 0x26690
leaq 0x67424(%rip), %rsi     # 0xc7d2a
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x608ba
nop