// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/discnt-cli.c
// Function: cliReadReply
static int cliReadReply(int output_raw_strings) {
    void *_reply;
    redisReply *reply;
    sds out = NULL;

    if (redisGetReply(context,&_reply) != REDIS_OK) {
        if (config.shutdown) {
            redisFree(context);
            context = NULL;
            return REDIS_OK;
        }
        if (config.interactive) {
            /* Filter cases where we should reconnect */
            if (context->err == REDIS_ERR_IO &&
                (errno == ECONNRESET || errno == EPIPE))
                return REDIS_ERR;
            if (context->err == REDIS_ERR_EOF)
                return REDIS_ERR;
        }
        cliPrintContextError();
        exit(1);
        return REDIS_ERR; /* avoid compiler warning */
    }

    reply = (redisReply*)_reply;

    config.last_cmd_type = reply->type;

    if (output_raw_strings) {
        out = cliFormatReplyRaw(reply);
    } else {
        if (config.output == OUTPUT_RAW) {
            out = cliFormatReplyRaw(reply);
            out = sdscat(out,"\n");
        } else if (config.output == OUTPUT_STANDARD) {
            out = cliFormatReplyTTY(reply,"");
        } else if (config.output == OUTPUT_CSV) {
            out = cliFormatReplyCSV(reply);
            out = sdscat(out,"\n");
        }
    }
    fwrite(out,sdslen(out),1,stdout);
    sdsfree(out);
    freeReplyObject(reply);
    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
movq 0x36d2f(%rip), %rdi     # 0x4cc98
movq %rsp, %rsi
callq 0x18d1b
testl %eax, %eax
je 0x15f9d
cmpl $0x0, 0x36c38(%rip)     # 0x4cbb4
je 0x15fba
movq 0x36d13(%rip), %rdi     # 0x4cc98
callq 0x18754
movq $0x0, 0x36d03(%rip) # 0x4cc98
xorl %r14d, %r14d
jmp 0x160c8
movq (%rsp), %rbx
movl (%rbx), %eax
movl %eax, 0x36cd7(%rip)     # 0x4cc80
testl %ebp, %ebp
je 0x16011
movq %rbx, %rdi
callq 0x1614a
jmp 0x1605b
cmpl $0x0, 0x36bef(%rip)     # 0x4cbb0
je 0x16002
movq 0x36cce(%rip), %rax     # 0x4cc98
movl (%rax), %ebx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0x3, %ebx
je 0x160c8
cmpl $0x1, %ebx
jne 0x16002
callq 0xc0a0
movl (%rax), %eax
cmpl $0x20, %eax
je 0x160c8
cmpl $0x68, %eax
je 0x160c8
cmpl $0x3, %ebx
je 0x160c8
callq 0x15f30
movl $0x1, %edi
callq 0xc5b0
movl 0x36bd1(%rip), %eax     # 0x4cbe8
testl %eax, %eax
je 0x1604c
cmpl $0x2, %eax
je 0x16033
cmpl $0x1, %eax
jne 0x160d6
movq %rbx, %rdi
callq 0x1614a
jmp 0x1603b
movq %rbx, %rdi
callq 0x16486
leaq 0x24b56(%rip), %rsi     # 0x3ab98
movq %rax, %rdi
callq 0x12259
jmp 0x1605b
leaq 0x24b46(%rip), %rsi     # 0x3ab99
movq %rbx, %rdi
callq 0x1627e
movq %rax, %r15
movzbl -0x1(%r15), %esi
movl %esi, %eax
andl $0x7, %eax
xorl %r14d, %r14d
cmpl $0x4, %eax
ja 0x1609f
leaq 0x23731(%rip), %rcx     # 0x397a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x160a1
movq -0x11(%r15), %rsi
jmp 0x160a1
movzwl -0x5(%r15), %esi
jmp 0x160a1
movl -0x9(%r15), %esi
jmp 0x160a1
movzbl -0x3(%r15), %esi
jmp 0x160a1
xorl %esi, %esi
movq 0x35f18(%rip), %rax     # 0x4bfc0
movq (%rax), %rcx
movl $0x1, %edx
movq %r15, %rdi
callq 0xc5d0
movq %r15, %rdi
callq 0x119ef
movq %rbx, %rdi
callq 0x17418
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x1605e