// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/networking.c
// Function: addReply
void addReply(client *c, robj *obj) {
    if (prepareClientToWrite(c) != C_OK) return;

    /* This is an important place where we can avoid copy-on-write
     * when there is a saving child running, avoiding touching the
     * refcount field of the object if it's not needed.
     *
     * If the encoding is RAW and there is room in the static buffer
     * we'll be able to send the object to the client without
     * messing with its page. */
    if (sdsEncodedObject(obj)) {
        if (_addReplyToBuffer(c,obj->ptr,sdslen(obj->ptr)) != C_OK)
            _addReplyObjectToList(c,obj);
    } else if (obj->encoding == OBJ_ENCODING_INT) {
        /* Optimization: if there is room in the static buffer for 32 bytes
         * (more than the max chars a 64 bit integer can take as string) we
         * avoid decoding the object and go for the lower level approach. */
        if (listLength(c->reply) == 0 && (sizeof(c->buf) - c->bufpos) >= 32) {
            char buf[32];
            int len;

            len = ll2string(buf,sizeof(buf),(long)obj->ptr);
            if (_addReplyToBuffer(c,buf,len) == C_OK)
                return;
            /* else... continue with the normal code path, but should never
             * happen actually since we verified there is room. */
        }
        obj = getDecodedObject(obj);
        if (_addReplyToBuffer(c,obj->ptr,sdslen(obj->ptr)) != C_OK)
            _addReplyObjectToList(c,obj);
        decrRefCount(obj);
    } else {
        serverPanic("Wrong obj->encoding in addReply()");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x423b0
cmpl $0x0, %eax
je 0x42ce3
jmp 0x42e3f
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x42d05
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x42d4d
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x42810
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0x425a0
cmpl $0x0, %eax
je 0x42d48
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x42660
jmp 0x42e3f
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x42e1b
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
cmpq $0x0, 0x28(%rax)
jne 0x42dc0
movq -0x8(%rbp), %rax
movslq 0x1c0(%rax), %rcx
movl $0x4000, %eax           # imm = 0x4000
subq %rcx, %rax
cmpq $0x20, %rax
jb 0x42dc0
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x20, %esi
callq 0x477e0
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movslq -0x34(%rbp), %rdx
callq 0x425a0
cmpl $0x0, %eax
jne 0x42dbe
jmp 0x42e3f
jmp 0x42dc0
movq -0x10(%rbp), %rdi
callq 0x494f0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x42810
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
callq 0x425a0
cmpl $0x0, %eax
je 0x42e10
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x42660
movq -0x10(%rbp), %rdi
callq 0x48f70
jmp 0x42e3d
leaq 0xf7c37(%rip), %rdi     # 0x13aa59
leaq 0xf7c0d(%rip), %rsi     # 0x13aa36
movl $0x169, %edx            # imm = 0x169
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x42e3f
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)