// File: /workspace/github_c_makefile_star2_O1/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 0x21d57
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
cmpq $0x0, 0x28(%rdi)
je 0x21d64
movq 0x8(%rdi), %r15
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x21e2b
movzbl -0x1(%rax), %ecx
movl %ecx, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x21da6
leaq 0x32c37(%rip), %rsi     # 0x54980
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %ecx
jmp 0x21da8
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1ded3
movq %r14, %rsi
callq 0x16aff
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21e71
leaq 0x32c4a(%rip), %rdx     # 0x549d0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq -0x11(%rax), %rcx
jmp 0x21da8
movzwl -0x5(%rax), %ecx
jmp 0x21da8
movl -0x9(%rax), %ecx
jmp 0x21da8
movzbl -0x3(%rax), %ecx
jmp 0x21da8
xorl %ecx, %ecx
movzbl -0x1(%r14), %edx
movl %edx, %esi
andl $0x7, %esi
cmpl $0x4, %esi
ja 0x21de6
leaq 0x32bd6(%rip), %r8      # 0x54994
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
shrl $0x3, %edx
jmp 0x21de8
movq -0x11(%r14), %rdx
jmp 0x21de8
movzwl -0x5(%r14), %edx
jmp 0x21de8
movl -0x9(%r14), %edx
jmp 0x21de8
movzbl -0x3(%r14), %edx
jmp 0x21de8
xorl %edx, %edx
addq %rcx, %rdx
cmpq $0x4000, %rdx           # imm = 0x4000
ja 0x21e2b
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e764
movq %rax, 0x10(%r15)
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21e9e
leaq 0x32b8b(%rip), %rdx     # 0x549a8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x21ea0
movq %r14, %rsi
callq 0x16aff
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21e71
leaq 0x32b73(%rip), %rdx     # 0x549bc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x21e73
movq -0x11(%r14), %rax
jmp 0x21e73
movzwl -0x5(%r14), %eax
jmp 0x21e73
movl -0x9(%r14), %eax
jmp 0x21e73
movzbl -0x3(%r14), %eax
jmp 0x21e73
xorl %eax, %eax
addq %rax, 0x60(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21c44
movq -0x11(%r14), %rax
jmp 0x21ea0
movzwl -0x5(%r14), %eax
jmp 0x21ea0
movl -0x9(%r14), %eax
jmp 0x21ea0
movzbl -0x3(%r14), %eax
jmp 0x21ea0
xorl %eax, %eax
addq %rax, 0x60(%rbx)
movq %r14, %rdi
callq 0x1ded3
jmp 0x21e77