// File: /workspace/github_c_makefile_star2_O0/erikdubbelboer[P]discnt/src/counter.c
// Function: getCommand
void getCommand(client *c) {
    counter *cntr;

    cntr = counterLookup(c->argv[1]->ptr);
    if (cntr == NULL) {
        if (c->argc == 2) {
            addReplyString(c,OBJ_SHARED_0STR,sizeof(OBJ_SHARED_0STR)-1);
        } else if (!strcasecmp(c->argv[2]->ptr,"state")) {
            addReplyMultiBulkLen(c,2);
            addReplyString(c,OBJ_SHARED_0STR,sizeof(OBJ_SHARED_0STR)-1);
            if (server.cluster->failing_nodes_count > 0) {
                addReplyString(c, OBJ_SHARED_INCONSISTENT, sizeof(OBJ_SHARED_INCONSISTENT)-1);
            } else {
                addReplyString(c, OBJ_SHARED_CONSISTENT, sizeof(OBJ_SHARED_CONSISTENT)-1);
            }
        }
        return;
    }

    countersUpdateValue(cntr);

    if (c->argc == 2) {
        addReplyCounter(c,cntr);
    } else if (!strcasecmp(c->argv[2]->ptr,"state")) {
        addReplyMultiBulkLen(c,2);
        addReplyCounter(c,cntr);
        if (server.cluster->failing_nodes_count > 0) {
            addReplyString(c, OBJ_SHARED_INCONSISTENT, sizeof(OBJ_SHARED_INCONSISTENT)-1);
        } else {
            addReplyString(c, OBJ_SHARED_CONSISTENT, sizeof(OBJ_SHARED_CONSISTENT)-1);
        }
    } else {
        addReplyErrorFormat(c, "Unknown GET option '%s'",
            (char*)c->argv[2]->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
callq 0x396f0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3a241
movq -0x8(%rbp), %rax
cmpl $0x2, 0x28(%rax)
jne 0x3a1b4
movq -0x8(%rbp), %rdi
leaq 0x6f1bf(%rip), %rsi     # 0xa9364
movl $0x7, %edx
callq 0x24260
jmp 0x3a23c
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x6f1a1(%rip), %rsi     # 0xa936c
callq 0x12070
cmpl $0x0, %eax
jne 0x3a23a
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x24b20
movq -0x8(%rbp), %rdi
leaq 0x6f176(%rip), %rsi     # 0xa9364
movl $0x7, %edx
callq 0x24260
leaq 0x84ee9(%rip), %rax     # 0xbf0e8
movq 0x668(%rax), %rax
cmpl $0x0, 0x3c(%rax)
jle 0x3a223
movq -0x8(%rbp), %rdi
leaq 0x6f15b(%rip), %rsi     # 0xa9372
movl $0x13, %edx
callq 0x24260
jmp 0x3a238
movq -0x8(%rbp), %rdi
leaq 0x6f158(%rip), %rsi     # 0xa9386
movl $0x11, %edx
callq 0x24260
jmp 0x3a23a
jmp 0x3a23c
jmp 0x3a308
movq -0x10(%rbp), %rdi
callq 0x398f0
movq -0x8(%rbp), %rax
cmpl $0x2, 0x28(%rax)
jne 0x3a266
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x398c0
jmp 0x3a308
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x6f0ef(%rip), %rsi     # 0xa936c
callq 0x12070
cmpl $0x0, %eax
jne 0x3a2e4
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x24b20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x398c0
leaq 0x84e3f(%rip), %rax     # 0xbf0e8
movq 0x668(%rax), %rax
cmpl $0x0, 0x3c(%rax)
jle 0x3a2cd
movq -0x8(%rbp), %rdi
leaq 0x6f0b1(%rip), %rsi     # 0xa9372
movl $0x13, %edx
callq 0x24260
jmp 0x3a2e2
movq -0x8(%rbp), %rdi
leaq 0x6f0ae(%rip), %rsi     # 0xa9386
movl $0x11, %edx
callq 0x24260
jmp 0x3a306
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x6f099(%rip), %rsi     # 0xa9398
movb $0x0, %al
callq 0x24360
jmp 0x3a308
addq $0x10, %rsp
popq %rbp
retq
nop