// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/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 0x219be
testl %eax, %eax
je 0x21f7a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl (%r14), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x21f95
cmpl $0x1, %eax
je 0x21fc6
testl %eax, %eax
jne 0x22168
movq 0x8(%r14), %rsi
movzbl -0x1(%rsi), %r15d
movl %r15d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x2208d
leaq 0x32a58(%rip), %rcx     # 0x54a0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r15d
jmp 0x22090
movq 0x58(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x22037
movslq 0xb8(%rbx), %rax
addq $-0x4001, %rax          # imm = 0xBFFF
cmpq $-0x21, %rax
ja 0x22037
movq 0x8(%r14), %rdx
movq %rsp, %rdi
movl $0x20, %esi
callq 0x2535e
testb $0x40, 0x88(%rbx)
jne 0x21f70
movq 0x58(%rbx), %rcx
cmpq $0x0, 0x28(%rcx)
jne 0x22037
movslq %eax, %r15
movslq 0xb8(%rbx), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x22037
leaq (%rbx,%rax), %rdi
addq $0xbc, %rdi
movq %rsp, %rsi
jmp 0x220c7
movq %r14, %rdi
callq 0x26071
movq %rax, %r14
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %r15d
movl %r15d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x22109
leaq 0x32997(%rip), %rcx     # 0x549f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r15d
jmp 0x2210c
movq -0x11(%rsi), %r15
jmp 0x22090
movzwl -0x5(%rsi), %r15d
jmp 0x22090
movl -0x9(%rsi), %r15d
jmp 0x22090
movzbl -0x3(%rsi), %r15d
jmp 0x22090
xorl %r15d, %r15d
testb $0x40, 0x88(%rbx)
jne 0x21f70
movq 0x58(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x220db
movslq 0xb8(%rbx), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x220db
leaq (%rbx,%rax), %rdi
addq $0xbc, %rdi
movq %r15, %rdx
callq 0x12520
addl %r15d, 0xb8(%rbx)
jmp 0x21f70
movq %rbx, %rdi
movq %r14, %rsi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x21aa5
movq -0x11(%rsi), %r15
jmp 0x2210c
movzwl -0x5(%rsi), %r15d
jmp 0x2210c
movl -0x9(%rsi), %r15d
jmp 0x2210c
movzbl -0x3(%rsi), %r15d
jmp 0x2210c
xorl %r15d, %r15d
testb $0x40, 0x88(%rbx)
jne 0x2215b
movq 0x58(%rbx), %rax
cmpq $0x0, 0x28(%rax)
jne 0x22150
movslq 0xb8(%rbx), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x22150
leaq (%rbx,%rax), %rdi
addq $0xbc, %rdi
movq %r15, %rdx
callq 0x12520
addl %r15d, 0xb8(%rbx)
jmp 0x2215b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21aa5
movq %r14, %rdi
callq 0x25d25
jmp 0x21f70
leaq 0x32ab0(%rip), %rdi     # 0x54c1f
leaq 0x32a9c(%rip), %rsi     # 0x54c12
movl $0x132, %edx            # imm = 0x132
callq 0x2ade4
movl $0x1, %edi
callq 0x12120