// File: /workspace/github_c_makefile_star2_O0/erikdubbelboer[P]discnt/src/config.c
// Function: configCommand
void configCommand(client *c) {
    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)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x7541a(%rip), %rsi     # 0xa427d
callq 0x12070
cmpl $0x0, %eax
jne 0x2ee8a
movq -0x8(%rbp), %rax
cmpl $0x4, 0x28(%rax)
je 0x2ee7c
jmp 0x2f015
movq -0x8(%rbp), %rdi
callq 0x2bcc0
jmp 0x2f013
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x74673(%rip), %rsi     # 0xa3514
callq 0x12070
cmpl $0x0, %eax
jne 0x2eec8
movq -0x8(%rbp), %rax
cmpl $0x3, 0x28(%rax)
je 0x2eeba
jmp 0x2f015
movq -0x8(%rbp), %rdi
callq 0x2c990
jmp 0x2f011
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x7793a(%rip), %rsi     # 0xa6819
callq 0x12070
cmpl $0x0, %eax
jne 0x2ef1b
movq -0x8(%rbp), %rax
cmpl $0x2, 0x28(%rax)
je 0x2eef8
jmp 0x2f015
callq 0x1b020
callq 0x1b5f0
movq -0x8(%rbp), %rdi
leaq 0x908eb(%rip), %rax     # 0xbf7f8
movq 0x8(%rax), %rsi
callq 0x24050
jmp 0x2f00f
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x778f1(%rip), %rsi     # 0xa6823
callq 0x12070
cmpl $0x0, %eax
jne 0x2effd
movq -0x8(%rbp), %rax
cmpl $0x2, 0x28(%rax)
je 0x2ef4f
jmp 0x2f015
leaq 0x90192(%rip), %rax     # 0xbf0e8
cmpq $0x0, 0x8(%rax)
jne 0x2ef72
movq -0x8(%rbp), %rdi
leaq 0x778c3(%rip), %rsi     # 0xa682b
callq 0x24320
jmp 0x2f037
leaq 0x9016f(%rip), %rax     # 0xbf0e8
movq 0x8(%rax), %rdi
callq 0x2ea10
cmpl $-0x1, %eax
jne 0x2efd4
callq 0x120b0
movl (%rax), %edi
callq 0x12900
movq %rax, %rdx
movl $0x3, %edi
leaq 0x778b5(%rip), %rsi     # 0xa6857
movb $0x0, %al
callq 0x18b10
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
callq 0x120b0
movl (%rax), %edi
callq 0x12900
movq -0x10(%rbp), %rdi
movq %rax, %rdx
leaq 0x778a6(%rip), %rsi     # 0xa6871
movb $0x0, %al
callq 0x24360
jmp 0x2effb
movl $0x3, %edi
leaq 0x778ab(%rip), %rsi     # 0xa688b
movb $0x0, %al
callq 0x18b10
movq -0x8(%rbp), %rdi
leaq 0x90806(%rip), %rax     # 0xbf7f8
movq 0x8(%rax), %rsi
callq 0x24050
jmp 0x2f00d
movq -0x8(%rbp), %rdi
leaq 0x778a9(%rip), %rsi     # 0xa68b1
callq 0x24320
jmp 0x2f00f
jmp 0x2f011
jmp 0x2f013
jmp 0x2f037
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x778bf(%rip), %rsi     # 0xa68ef
movb $0x0, %al
callq 0x24360
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)