// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xc315b(%rip), %r14     # 0x1018a8
movq %rdi, 0x1f0(%r14)
leaq 0x8174d(%rip), %r15     # 0xbfea8
movq 0x28(%rbx), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x3e836
movslq (%r15,%rdx,4), %rdx
addq %r15, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x3e794
movq -0x11(%rcx), %rax
jmp 0x3e794
movzwl -0x5(%rcx), %eax
jmp 0x3e794
movl -0x9(%rcx), %eax
jmp 0x3e794
movzbl -0x3(%rcx), %eax
testq %rax, %rax
je 0x3e836
movl 0x98(%rbx), %eax
testb $0x1, %al
jne 0x3e7ba
callq 0x3e869
testl %eax, %eax
jne 0x3e836
movl 0x98(%rbx), %eax
testl $0x450, %eax            # imm = 0x450
jne 0x3e836
movl 0x58(%rbx), %eax
cmpl $0x2, %eax
je 0x3e7e2
cmpl $0x1, %eax
je 0x3e7f3
testl %eax, %eax
jne 0x3e847
movq 0x28(%rbx), %rax
cmpb $0x2a, (%rax)
jne 0x3e7ec
movl $0x2, 0x58(%rbx)
movq %rbx, %rdi
callq 0x3e1e2
jmp 0x3e7fb
movl $0x1, 0x58(%rbx)
movq %rbx, %rdi
callq 0x3df8b
testl %eax, %eax
jne 0x3e836
cmpl $0x0, 0x38(%rbx)
je 0x3e829
movq %rbx, %rdi
callq 0x331cf
testl %eax, %eax
jne 0x3e819
movq %rbx, %rdi
callq 0x3df0d
cmpq $0x0, 0x1f0(%r14)
jne 0x3e75b
jmp 0x3e836
movq %rbx, %rdi
callq 0x3df0d
jmp 0x3e75b
movq $0x0, 0x1f0(%r14)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x8196d(%rip), %rdi     # 0xc01bb
leaq 0x81701(%rip), %rsi     # 0xbff56
movl $0x50b, %edx            # imm = 0x50B
callq 0x619b4
movl $0x1, %edi
callq 0x263c0