// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
callq 0x1ed50
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x5, %eax
ja 0x17746
movq -0x28(%rbp), %rax
leaq 0x6fc7d(%rip), %rcx     # 0x87224
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x1776e
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x1f8a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x74dbe(%rip), %rsi     # 0x8c39b
movl $0x1, %edx
callq 0x1f8a0
movq %rax, -0x10(%rbp)
jmp 0x1776e
movq -0x8(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x1766e
cmpl $0x0, 0x89fc0(%rip)     # 0xa15c0
je 0x1766e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x748f8(%rip), %rsi     # 0x8bf09
callq 0x106a0
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x1764f
movl $0x0, 0x89fa2(%rip)     # 0xa15cc
movl $0x0, 0x89f8c(%rip)     # 0xa15c0
movl $0x1, 0x89f8a(%rip)     # 0xa15c8
movl $0x0, 0x89ee0(%rip)     # 0xa1528
callq 0x17480
jmp 0x1766c
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x12d20
movq %rax, -0x10(%rbp)
jmp 0x1768b
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x1f8a0
movq %rax, -0x10(%rbp)
jmp 0x1776e
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x74873(%rip), %rsi     # 0x8bf16
movb $0x0, %al
callq 0x1fe10
movq %rax, -0x10(%rbp)
jmp 0x1776e
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x17744
cmpq $0x0, -0x20(%rbp)
jbe 0x176e4
movq -0x10(%rbp), %rdi
movq 0x89e55(%rip), %rsi     # 0xa1530
callq 0x1f930
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x17570
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17c20
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
callq 0x1f8a0
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1ee80
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x176bb
jmp 0x1776e
movq 0x878a3(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %edx
leaq 0x747be(%rip), %rsi     # 0x8bf1b
movb $0x0, %al
callq 0x10360
movl $0x1, %edi
callq 0x10600
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)