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

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

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

        /* Append to this object when possible. */
        if (tail->ptr != NULL && tail->encoding == REDIS_ENCODING_RAW &&
            sdslen(tail->ptr)+sdslen(s) <= REDIS_REPLY_CHUNK_BYTES)
        {
            c->reply_bytes -= zmalloc_size_sds(tail->ptr);
            tail = dupLastObjectIfNeeded(c->reply);
            tail->ptr = sdscatlen(tail->ptr,s,sdslen(s));
            c->reply_bytes += zmalloc_size_sds(tail->ptr);
            sdsfree(s);
        } else {
            listAddNodeTail(c->reply,createObject(REDIS_STRING,s));
            c->reply_bytes += zmalloc_size_sds(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 0x90(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x35740
movq -0x10(%rbp), %rdi
callq 0x2c160
jmp 0x358cc
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
cmpq $0x0, 0x28(%rax)
jne 0x3578f
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0x3a0d0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x1ff90
movq -0x10(%rbp), %rdi
callq 0x34840
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x68(%rax), %rcx
movq %rcx, 0x68(%rax)
jmp 0x358c3
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x35886
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x35886
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x34800
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x34800
movq %rax, %rcx
movq -0x28(%rbp), %rax
addq %rcx, %rax
cmpq $0x4000, %rax           # imm = 0x4000
ja 0x35886
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x34840
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x35350
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 0x34800
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
callq 0x2c500
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x34840
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x68(%rax), %rcx
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rdi
callq 0x2c160
jmp 0x358c1
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
xorl %edi, %edi
callq 0x3a0d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x1ff90
movq -0x10(%rbp), %rdi
callq 0x34840
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x68(%rax), %rcx
movq %rcx, 0x68(%rax)
jmp 0x358c3
movq -0x8(%rbp), %rdi
callq 0x35650
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)