// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/networking.c
// Function: processInputBuffer
void processInputBuffer(client *c) {
    server.current_client = c;
    /* Keep processing while there is something in the input buffer */
    while(sdslen(c->querybuf)) {
        /* Return if clients are paused. */
        if (!(c->flags & CLIENT_SLAVE) && clientsArePaused()) break;

        /* Immediately abort if the client is in the middle of something. */
        if (c->flags & CLIENT_BLOCKED) break;

        /* CLIENT_CLOSE_AFTER_REPLY closes the connection once the reply is
         * written to the client. Make sure to not let the reply grow after
         * this flag has been set (i.e. don't process more commands).
         *
         * The same applies for clients we want to terminate ASAP. */
        if (c->flags & (CLIENT_CLOSE_AFTER_REPLY|CLIENT_CLOSE_ASAP)) break;

        /* Determine request type when unknown. */
        if (!c->reqtype) {
            if (c->querybuf[0] == '*') {
                c->reqtype = PROTO_REQ_MULTIBULK;
            } else {
                c->reqtype = PROTO_REQ_INLINE;
            }
        }

        if (c->reqtype == PROTO_REQ_INLINE) {
            if (processInlineBuffer(c) != C_OK) break;
        } else if (c->reqtype == PROTO_REQ_MULTIBULK) {
            if (processMultibulkBuffer(c) != C_OK) break;
        } else {
            serverPanic("Unknown request type");
        }

        /* Multibulk processing could see a <= 0 length. */
        if (c->argc == 0) {
            resetClient(c);
        } else {
            /* Only reset the client when the command was executed. */
            if (processCommand(c) == C_OK)
                resetClient(c);
            /* freeMemoryIfNeeded may flush slave output buffers. This may result
             * into a slave, that may be the active client, to be freed. */
            if (server.current_client == NULL) break;
        }
    }
    server.current_client = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xc4d2c(%rip), %r14     # 0x106858
movq %rdi, 0x1f0(%r14)
leaq 0x81326(%rip), %r15     # 0xc2e60
movq 0x28(%rbx), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x41b71
movslq (%r15,%rdx,4), %rdx
addq %r15, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x41b73
movq -0x11(%rcx), %rax
jmp 0x41b73
movzwl -0x5(%rcx), %eax
jmp 0x41b73
movl -0x9(%rcx), %eax
jmp 0x41b73
movzbl -0x3(%rcx), %eax
jmp 0x41b73
xorl %eax, %eax
testq %rax, %rax
je 0x41c0d
testb $0x1, 0x98(%rbx)
jne 0x41b8e
callq 0x41c40
testl %eax, %eax
jne 0x41c0d
movzwl 0x98(%rbx), %eax
testl $0x450, %eax            # imm = 0x450
jne 0x41c0d
cmpl $0x0, 0x58(%rbx)
jne 0x41bb3
movq 0x28(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x2a, (%rax)
sete %cl
incl %ecx
movl %ecx, 0x58(%rbx)
movl 0x58(%rbx), %eax
cmpl $0x2, %eax
je 0x41bca
cmpl $0x1, %eax
jne 0x41c1e
movq %rbx, %rdi
callq 0x4132e
jmp 0x41bd2
movq %rbx, %rdi
callq 0x4159f
testl %eax, %eax
jne 0x41c0d
cmpl $0x0, 0x38(%rbx)
je 0x41c00
movq %rbx, %rdi
callq 0x36226
testl %eax, %eax
jne 0x41bf0
movq %rbx, %rdi
callq 0x412a9
cmpq $0x0, 0x1f0(%r14)
jne 0x41b3a
jmp 0x41c0d
movq %rbx, %rdi
callq 0x412a9
jmp 0x41b3a
movq $0x0, 0x1f0(%r14)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8154e(%rip), %rdi     # 0xc3173
leaq 0x812e2(%rip), %rsi     # 0xc2f0e
movl $0x50b, %edx            # imm = 0x50B
callq 0x6558d
movl $0x1, %edi
callq 0x263d0