// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3c20d
testl %eax, %eax
je 0x3c876
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl (%r14), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x3c891
cmpl $0x1, %eax
je 0x3c8c2
testl %eax, %eax
jne 0x3ca64
movq 0x8(%r14), %rsi
movzbl -0x1(%rsi), %r15d
movl %r15d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x3c989
leaq 0x834cc(%rip), %rcx     # 0xbfd7c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r15d
jmp 0x3c98c
movq 0x68(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x3c933
movslq 0x1c0(%rbx), %rax
addq $-0x4001, %rax          # imm = 0xBFFF
cmpq $-0x21, %rax
ja 0x3c933
movq 0x8(%r14), %rdx
movq %rsp, %rdi
movl $0x20, %esi
callq 0x3ff83
testb $0x40, 0x98(%rbx)
jne 0x3c86c
movq 0x68(%rbx), %rcx
cmpq $0x0, 0x28(%rcx)
jne 0x3c933
movslq %eax, %r15
movslq 0x1c0(%rbx), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x3c933
leaq (%rbx,%rax), %rdi
addq $0x1c4, %rdi            # imm = 0x1C4
movq %rsp, %rsi
jmp 0x3c9c3
movq %r14, %rdi
callq 0x41026
movq %rax, %r14
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %r15d
movl %r15d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x3ca05
leaq 0x8340b(%rip), %rcx     # 0xbfd68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r15d
jmp 0x3ca08
movq -0x11(%rsi), %r15
jmp 0x3c98c
movzwl -0x5(%rsi), %r15d
jmp 0x3c98c
movl -0x9(%rsi), %r15d
jmp 0x3c98c
movzbl -0x3(%rsi), %r15d
jmp 0x3c98c
xorl %r15d, %r15d
testb $0x40, 0x98(%rbx)
jne 0x3c86c
movq 0x68(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x3c9d7
movslq 0x1c0(%rbx), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x3c9d7
leaq (%rbx,%rax), %rdi
addq $0x1c4, %rdi            # imm = 0x1C4
movq %r15, %rdx
callq 0x26c50
addl %r15d, 0x1c0(%rbx)
jmp 0x3c86c
movq %rbx, %rdi
movq %r14, %rsi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x3c37e
movq -0x11(%rsi), %r15
jmp 0x3ca08
movzwl -0x5(%rsi), %r15d
jmp 0x3ca08
movl -0x9(%rsi), %r15d
jmp 0x3ca08
movzbl -0x3(%rsi), %r15d
jmp 0x3ca08
xorl %r15d, %r15d
testb $0x40, 0x98(%rbx)
jne 0x3ca57
movq 0x68(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x3ca4c
movslq 0x1c0(%rbx), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x3ca4c
leaq (%rbx,%rax), %rdi
addq $0x1c4, %rdi            # imm = 0x1C4
movq %r15, %rdx
callq 0x26c50
addl %r15d, 0x1c0(%rbx)
jmp 0x3ca57
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c37e
movq %r14, %rdi
callq 0x40c8f
jmp 0x3c86c
leaq 0x8350e(%rip), %rdi     # 0xbff79
leaq 0x834e4(%rip), %rsi     # 0xbff56
movl $0x169, %edx            # imm = 0x169
callq 0x619b4
movl $0x1, %edi
callq 0x263c0