// File: /workspace/github_c_makefile_star2_O3/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 0x37383(%rip), %rdi     # 0x4cc98
movq %rsp, %rsi
callq 0x1883b
testl %eax, %eax
je 0x15949
cmpl $0x0, 0x3728c(%rip)     # 0x4cbb4
je 0x15966
movq 0x37367(%rip), %rdi     # 0x4cc98
callq 0x182ba
movq $0x0, 0x37357(%rip) # 0x4cc98
xorl %r14d, %r14d
jmp 0x15a6b
movq (%rsp), %rbx
movl (%rbx), %eax
movl %eax, 0x3732b(%rip)     # 0x4cc80
testl %ebp, %ebp
je 0x159b4
movq %rbx, %rdi
callq 0x15aed
jmp 0x159fe
cmpl $0x0, 0x37243(%rip)     # 0x4cbb0
je 0x159a5
movq 0x37322(%rip), %rax     # 0x4cc98
movl (%rax), %eax
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0x3, %eax
je 0x15a6b
cmpl $0x1, %eax
jne 0x159a5
callq 0xc0a0
movl (%rax), %eax
cmpl $0x20, %eax
je 0x15a6b
cmpl $0x68, %eax
je 0x15a6b
callq 0x158dc
movl $0x1, %edi
callq 0xc5b0
movl 0x3722e(%rip), %eax     # 0x4cbe8
testl %eax, %eax
je 0x159ef
cmpl $0x2, %eax
je 0x159d6
cmpl $0x1, %eax
jne 0x15a79
movq %rbx, %rdi
callq 0x15aed
jmp 0x159de
movq %rbx, %rdi
callq 0x15e29
leaq 0x251ec(%rip), %rsi     # 0x3abd1
movq %rax, %rdi
callq 0x11cb1
jmp 0x159fe
leaq 0x251dc(%rip), %rsi     # 0x3abd2
movq %rbx, %rdi
callq 0x15c21
movq %rax, %r15
movzbl -0x1(%r15), %esi
movl %esi, %eax
andl $0x7, %eax
xorl %r14d, %r14d
cmpl $0x4, %eax
ja 0x15a42
leaq 0x23de2(%rip), %rcx     # 0x397fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x15a44
movq -0x11(%r15), %rsi
jmp 0x15a44
movzwl -0x5(%r15), %esi
jmp 0x15a44
movl -0x9(%r15), %esi
jmp 0x15a44
movzbl -0x3(%r15), %esi
jmp 0x15a44
xorl %esi, %esi
movq 0x36575(%rip), %rax     # 0x4bfc0
movq (%rax), %rcx
movl $0x1, %edx
movq %r15, %rdi
callq 0xc5d0
movq %r15, %rdi
callq 0x11441
movq %rbx, %rdi
callq 0x16fac
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x15a01