// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x18ec4
movq %rax, %rbx
movl (%r14), %edx
leal -0x1(%rdx), %eax
cmpl $0x5, %eax
ja 0x156a5
leaq 0x25cc6(%rip), %rcx     # 0x3b23c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%r14), %r15
cmpl $0x5, %edx
jne 0x155c5
cmpl $0x0, 0x40fb1(%rip)     # 0x56540
je 0x155c5
leaq 0x2a8dd(%rip), %rsi     # 0x3fe75
pushq $0xc
popq %rdx
movq %r15, %rdi
callq 0x100c0
testl %eax, %eax
je 0x15678
movslq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x11be6
movslq 0x10(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x15648
xorl %r12d, %r12d
cmpq 0x20(%r14), %r12
jae 0x15696
testq %r12, %r12
je 0x155f5
movq 0x40ec6(%rip), %rsi     # 0x564b0
movq %rbx, %rdi
callq 0x1952f
movq %rax, %rbx
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x1554d
movq %rax, %r15
movq %rax, %rdi
callq 0x159d8
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x194d0
movq %rax, %rbx
movq %r15, %rdi
callq 0x18f40
incq %r12
jmp 0x155d4
movq 0x18(%r14), %rsi
movslq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x194d0
leaq 0x2ab9d(%rip), %rsi     # 0x401df
pushq $0x1
popq %rdx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x194d0
movq 0x8(%r14), %rdx
leaq 0x2a81f(%rip), %rsi     # 0x3fe82
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x197b0
andl $0x0, 0x40ec1(%rip)     # 0x56540
movq $0x1, 0x40ebe(%rip) # 0x56548
andl $0x0, 0x40e17(%rip)     # 0x564a8
callq 0x15497
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x3e94c(%rip), %rax     # 0x53ff8
movq (%rax), %rdi
leaq 0x2a7d1(%rip), %rsi     # 0x3fe87
xorl %eax, %eax
callq 0x103b0
pushq $0x1
popq %rdi
callq 0x10630