// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplySdsToList
void _addReplySdsToList(client *c, sds s) {
    if (c->flags & CLIENT_CLOSE_AFTER_REPLY) {
        sdsfree(s);
        return;
    }

    if (listLength(c->reply) == 0) {
        listAddNodeTail(c->reply,s);
        c->reply_bytes += sdslen(s);
    } else {
        listNode *ln = listLast(c->reply);
        sds tail = listNodeValue(ln);

        /* Append to this object when possible. If tail == NULL it was
         * set via addDeferredMultiBulkLength(). */
        if (tail && sdslen(tail)+sdslen(s) <= PROTO_REPLY_CHUNK_BYTES) {
            tail = sdscatsds(tail,s);
            listNodeValue(ln) = tail;
            c->reply_bytes += sdslen(s);
            sdsfree(s);
        } else {
            listAddNodeTail(c->reply,s);
            c->reply_bytes += sdslen(s);
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
testb $0x40, 0x88(%rdi)
jne 0x21a59
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
cmpq $0x0, 0x28(%rdi)
je 0x21a66
movq 0x8(%rdi), %r15
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x21b2d
movzbl -0x1(%rax), %ecx
movl %ecx, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x21aa8
leaq 0x32f85(%rip), %rsi     # 0x549d0
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %ecx
jmp 0x21aaa
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1dc25
movq %r14, %rsi
callq 0x165ab
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21b73
leaq 0x32f98(%rip), %rdx     # 0x54a20
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq -0x11(%rax), %rcx
jmp 0x21aaa
movzwl -0x5(%rax), %ecx
jmp 0x21aaa
movl -0x9(%rax), %ecx
jmp 0x21aaa
movzbl -0x3(%rax), %ecx
jmp 0x21aaa
xorl %ecx, %ecx
movzbl -0x1(%r14), %edx
movl %edx, %esi
andl $0x7, %esi
cmpl $0x4, %esi
ja 0x21ae8
leaq 0x32f24(%rip), %r8      # 0x549e4
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
shrl $0x3, %edx
jmp 0x21aea
movq -0x11(%r14), %rdx
jmp 0x21aea
movzwl -0x5(%r14), %edx
jmp 0x21aea
movl -0x9(%r14), %edx
jmp 0x21aea
movzbl -0x3(%r14), %edx
jmp 0x21aea
xorl %edx, %edx
addq %rcx, %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
ja 0x21b2d
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e4bc
movq %rax, 0x10(%r15)
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21ba0
leaq 0x32ed9(%rip), %rdx     # 0x549f8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x21ba2
movq %r14, %rsi
callq 0x165ab
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21b73
leaq 0x32ec1(%rip), %rdx     # 0x54a0c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x21b75
movq -0x11(%r14), %rax
jmp 0x21b75
movzwl -0x5(%r14), %eax
jmp 0x21b75
movl -0x9(%r14), %eax
jmp 0x21b75
movzbl -0x3(%r14), %eax
jmp 0x21b75
xorl %eax, %eax
addq %rax, 0x60(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21946
movq -0x11(%r14), %rax
jmp 0x21ba2
movzwl -0x5(%r14), %eax
jmp 0x21ba2
movl -0x9(%r14), %eax
jmp 0x21ba2
movzbl -0x3(%r14), %eax
jmp 0x21ba2
xorl %eax, %eax
addq %rax, 0x60(%rbx)
movq %r14, %rdi
callq 0x1dc25
jmp 0x21b79