// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-cli.c
// Function: cliFormatReplyRaw
static sds cliFormatReplyRaw(redisReply *r) {
    sds out = sdsempty(), tmp;
    size_t i;

    switch (r->type) {
    case REDIS_REPLY_NIL:
        /* Nothing... */
        break;
    case REDIS_REPLY_ERROR:
        out = sdscatlen(out,r->str,r->len);
        out = sdscatlen(out,"\n",1);
        break;
    case REDIS_REPLY_STATUS:
    case REDIS_REPLY_STRING:
        if (r->type == REDIS_REPLY_STATUS && config.eval_ldb) {
            /* The Lua debugger replies with arrays of simple (status)
             * strings. We colorize the output for more fun if this
             * is a debugging session. */

            /* Detect the end of a debugging session. */
            if (strstr(r->str,"<endsession>") == r->str) {
                config.enable_ldb_on_eval = 0;
                config.eval_ldb = 0;
                config.eval_ldb_end = 1; /* Signal the caller session ended. */
                config.output = OUTPUT_STANDARD;
                cliRefreshPrompt();
            } else {
                out = sdsCatColorizedLdbReply(out,r->str,r->len);
            }
        } else {
            out = sdscatlen(out,r->str,r->len);
        }
        break;
    case REDIS_REPLY_INTEGER:
        out = sdscatprintf(out,"%lld",r->integer);
        break;
    case REDIS_REPLY_ARRAY:
        for (i = 0; i < r->elements; i++) {
            if (i > 0) out = sdscat(out,config.mb_delim);
            tmp = cliFormatReplyRaw(r->element[i]);
            out = sdscatlen(out,tmp,sdslen(tmp));
            sdsfree(tmp);
        }
        break;
    default:
        fprintf(stderr,"Unknown reply type: %d\n", r->type);
        exit(1);
    }
    return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
callq 0x21faf
movq %rax, %rbx
movl (%r14), %edi
leal -0x1(%rdi), %eax
cmpl $0x5, %eax
ja 0x1e058
leaq 0x2635a(%rip), %rcx     # 0x44248
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%r14), %r15
cmpl $0x5, %edi
jne 0x1df3d
cmpl $0x0, 0x42679(%rip)     # 0x60580
je 0x1df3d
leaq 0x2afe5(%rip), %rsi     # 0x48ef5
movl $0xc, %edx
movq %r15, %rdi
callq 0x110c0
testl %eax, %eax
je 0x1e02d
movslq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1a48a
movslq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x1e001
cmpq $0x0, 0x20(%r14)
je 0x1e04b
xorl %r12d, %r12d
leaq 0x262ff(%rip), %r13     # 0x44260
testq %r12, %r12
je 0x1df78
movq 0x42583(%rip), %rsi     # 0x604f0
movq %rbx, %rdi
callq 0x228ad
movq %rax, %rbx
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x1dec4
movq %rax, %r15
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x1dfbf
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x1dfc1
movq -0x11(%r15), %rdx
jmp 0x1dfc1
movzwl -0x5(%r15), %edx
jmp 0x1dfc1
movl -0x9(%r15), %edx
jmp 0x1dfc1
movzbl -0x3(%r15), %edx
jmp 0x1dfc1
xorl %edx, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x227dd
movq %rax, %rbx
movq %r15, %rdi
callq 0x22043
incq %r12
cmpq 0x20(%r14), %r12
jb 0x1df61
jmp 0x1e04b
movq 0x18(%r14), %rsi
movslq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x227dd
leaq 0x2b266(%rip), %rsi     # 0x4925f
movl $0x1, %edx
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x227dd
movq 0x8(%r14), %rdx
leaq 0x2aee8(%rip), %rsi     # 0x48f02
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x22c3e
xorl %eax, %eax
movl %eax, 0x4254b(%rip)     # 0x60580
movq $0x1, 0x42548(%rip) # 0x60588
movl %eax, 0x424a2(%rip)     # 0x604e8
callq 0x1de0e
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x11eba