// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/networking.c
// Function: processInlineBuffer
int processInlineBuffer(client *c) {
    char *newline;
    int argc, j;
    sds *argv, aux;
    size_t querylen;

    /* Search for end of line */
    newline = strchr(c->querybuf,'\n');

    /* Nothing to do without a \r\n */
    if (newline == NULL) {
        if (sdslen(c->querybuf) > PROTO_INLINE_MAX_SIZE) {
            addReplyError(c,"Protocol error: too big inline request");
            setProtocolError(c,0);
        }
        return C_ERR;
    }

    /* Handle the \r\n case. */
    if (newline && newline != c->querybuf && *(newline-1) == '\r')
        newline--;

    /* Split the input buffer up to the \r\n */
    querylen = newline-(c->querybuf);
    aux = sdsnewlen(c->querybuf,querylen);
    argv = sdssplitargs(aux,&argc);
    sdsfree(aux);
    if (argv == NULL) {
        addReplyError(c,"Protocol error: unbalanced quotes in request");
        setProtocolError(c,0);
        return C_ERR;
    }

    /* Newline from slaves can be used to refresh the last ACK time.
     * This is useful for a slave to ping back while loading a big
     * RDB file. */
    if (querylen == 0 && c->flags & CLIENT_SLAVE)
        c->repl_ack_time = server.unixtime;

    /* Leave data after the first line of the query in the buffer */
    sdsrange(c->querybuf,querylen+2,-1);

    /* Setup argv array on client structure */
    if (argc) {
        if (c->argv) zfree(c->argv);
        c->argv = zmalloc(sizeof(robj*)*argc);
    }

    /* Create redis objects for all arguments. */
    for (c->argc = 0, j = 0; j < argc; j++) {
        if (sdslen(argv[j])) {
            c->argv[c->argc] = createObject(OBJ_STRING,argv[j]);
            c->argc++;
        } else {
            sdsfree(argv[j]);
        }
    }
    zfree(argv);
    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r15
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0x267f0
testq %rax, %rax
je 0x37dbe
movq %r15, %rbp
cmpq %r15, %rax
je 0x37cd0
leaq -0x1(%rax), %rbp
cmpb $0xd, -0x1(%rax)
cmovneq %rax, %rbp
movq %rbp, %r12
subq %r15, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x31018
movq %rax, %r13
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x32388
movq %rax, %r14
movq %r13, %rdi
callq 0x311c8
testq %r14, %r14
je 0x37dec
cmpq %r15, %rbp
jne 0x37d28
testb $0x1, 0x98(%rbx)
je 0x37d28
leaq 0xc1b8e(%rip), %rax     # 0xf98a8
movq 0x978(%rax), %rax
movq %rax, 0xd8(%rbx)
movq 0x28(%rbx), %rdi
addl $0x2, %r12d
pushq $-0x1
popq %rdx
movl %r12d, %esi
callq 0x31e8e
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x37d65
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x37d55
callq 0x328f9
movl 0x4(%rsp), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x327b9
movq %rax, 0x40(%rbx)
andl $0x0, 0x38(%rbx)
xorl %r12d, %r12d
movslq 0x4(%rsp), %rax
cmpq %rax, %r12
jge 0x37db2
movq (%r14,%r12,8), %r15
movq %r15, %rdi
callq 0x3670c
testq %rax, %rax
je 0x37da5
xorl %edi, %edi
movq %r15, %rsi
callq 0x39d58
movq 0x40(%rbx), %rcx
movslq 0x38(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, 0x38(%rbx)
jmp 0x37dad
movq %r15, %rdi
callq 0x311c8
incq %r12
jmp 0x37d6c
movq %r14, %rdi
callq 0x328f9
xorl %ebp, %ebp
jmp 0x37e08
movq %r15, %rdi
callq 0x3670c
pushq $-0x1
popq %rbp
cmpq $0x10001, %rax          # imm = 0x10001
jb 0x37e08
leaq 0x79c33(%rip), %rsi     # 0xb1a0b
movq %rbx, %rdi
callq 0x36b6f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x37e19
jmp 0x37e08
leaq 0x79c3f(%rip), %rsi     # 0xb1a32
movq %rbx, %rdi
callq 0x36b6f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x37e19
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq