// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/networking.c
// Function: addReplySdsToList
void _addReplySdsToList(client *c, sds s) {
    robj *tail;

    if (c->flags & CLIENT_CLOSE_AFTER_REPLY) {
        sdsfree(s);
        return;
    }

    if (listLength(c->reply) == 0) {
        listAddNodeTail(c->reply,createObject(OBJ_STRING,s));
        c->reply_bytes += sdsZmallocSize(s);
    } else {
        tail = listNodeValue(listLast(c->reply));

        /* Append to this object when possible. */
        if (tail->ptr != NULL && tail->encoding == OBJ_ENCODING_RAW &&
            sdslen(tail->ptr)+sdslen(s) <= PROTO_REPLY_CHUNK_BYTES)
        {
            c->reply_bytes -= sdsZmallocSize(tail->ptr);
            tail = dupLastObjectIfNeeded(c->reply);
            tail->ptr = sdscatlen(tail->ptr,s,sdslen(s));
            c->reply_bytes += sdsZmallocSize(tail->ptr);
            sdsfree(s);
        } else {
            listAddNodeTail(c->reply,createObject(OBJ_STRING,s));
            c->reply_bytes += sdsZmallocSize(s);
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x42990
movq -0x10(%rbp), %rdi
callq 0x38620
jmp 0x42b1c
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
cmpq $0x0, 0x28(%rax)
jne 0x429df
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0x48480
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x27000
movq -0x10(%rbp), %rdi
callq 0x41c70
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x70(%rax), %rcx
movq %rcx, 0x70(%rax)
jmp 0x42b13
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x42ad6
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x42ad6
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x42810
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x42810
movq %rax, %rcx
movq -0x28(%rbp), %rax
addq %rcx, %rax
cmpq $0x4000, %rax           # imm = 0x4000
ja 0x42ad6
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x41c70
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x42510
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x42810
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
callq 0x39040
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x41c70
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x70(%rax), %rcx
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rdi
callq 0x38620
jmp 0x42b11
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0x48480
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x27000
movq -0x10(%rbp), %rdi
callq 0x41c70
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x70(%rax), %rcx
movq %rcx, 0x70(%rax)
jmp 0x42b13
movq -0x8(%rbp), %rdi
callq 0x428a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)