// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliFormatReplyCSV
static sds cliFormatReplyCSV(redisReply *r) {
    unsigned int i;

    sds out = sdsempty();
    switch (r->type) {
    case REDIS_REPLY_ERROR:
        out = sdscat(out,"ERROR,");
        out = sdscatrepr(out,r->str,strlen(r->str));
    break;
    case REDIS_REPLY_STATUS:
        out = sdscatrepr(out,r->str,r->len);
    break;
    case REDIS_REPLY_INTEGER:
        out = sdscatprintf(out,"%lld",r->integer);
    break;
    case REDIS_REPLY_STRING:
        out = sdscatrepr(out,r->str,r->len);
    break;
    case REDIS_REPLY_NIL:
        out = sdscat(out,"NIL");
    break;
    case REDIS_REPLY_ARRAY:
        for (i = 0; i < r->elements; i++) {
            sds tmp = cliFormatReplyCSV(r->element[i]);
            out = sdscatlen(out,tmp,sdslen(tmp));
            if (i != r->elements-1) out = sdscat(out,",");
            sdsfree(tmp);
        }
    break;
    default:
        fprintf(stderr,"Unknown reply type: %d\n", r->type);
        exit(1);
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
callq 0x1ed50
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x5, %eax
ja 0x17bec
movq -0x28(%rbp), %rax
leaq 0x6f7dd(%rip), %rcx     # 0x87254
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
leaq 0x744eb(%rip), %rsi     # 0x8bf76
callq 0x1f930
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x101a0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
callq 0x20b20
movq %rax, -0x18(%rbp)
jmp 0x17c14
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x20b20
movq %rax, -0x18(%rbp)
jmp 0x17c14
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x74413(%rip), %rsi     # 0x8bf16
movb $0x0, %al
callq 0x1fe10
movq %rax, -0x18(%rbp)
jmp 0x17c14
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x20b20
movq %rax, -0x18(%rbp)
jmp 0x17c14
movq -0x18(%rbp), %rdi
leaq 0x7443d(%rip), %rsi     # 0x8bf7d
callq 0x1f930
movq %rax, -0x18(%rbp)
jmp 0x17c14
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x17bea
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x17a40
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x17c20
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0x1f8a0
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x17bd3
movq -0x18(%rbp), %rdi
leaq 0x743b1(%rip), %rsi     # 0x8bf7b
callq 0x1f930
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1ee80
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x17b55
jmp 0x17c14
movq 0x873fd(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl (%rax), %edx
leaq 0x74318(%rip), %rsi     # 0x8bf1b
movb $0x0, %al
callq 0x10360
movl $0x1, %edi
callq 0x10600
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop