// File: /workspace/github_c_makefile_star2_O0/winton[P]redis_parse/hiredis/async.c
// Function: redisProcessCallbacks
void redisProcessCallbacks(redisAsyncContext *ac) {
    redisContext *c = &(ac->c);
    redisCallback cb;
    void *reply = NULL;
    int status;

    while((status = redisGetReply(c,&reply)) == REDIS_OK) {
        if (reply == NULL) {
            /* When the connection is being disconnected and there are
             * no more replies, this is the cue to really disconnect. */
            if (c->flags & REDIS_DISCONNECTING && sdslen(c->obuf) == 0) {
                __redisAsyncDisconnect(ac);
                return;
            }

            /* When the connection is not being disconnected, simply stop
             * trying to get replies and wait for the next loop tick. */
            break;
        }

        /* Even if the context is subscribed, pending regular callbacks will
         * get a reply before pub/sub messages arrive. */
        if (__redisShiftCallback(&ac->replies,&cb) != REDIS_OK) {
            /* A spontaneous reply in a not-subscribed context can only be the
             * error reply that is sent when a new connection exceeds the
             * maximum number of allowed connections on the server side. This
             * is seen as an error instead of a regular reply because the
             * server closes the connection after sending it. To prevent the
             * error from being overwritten by an EOF error the connection is
             * closed here. See issue #43. */
            if ( !(c->flags & REDIS_SUBSCRIBED) && ((redisReply*)reply)->type == REDIS_REPLY_ERROR ) {
                c->err = REDIS_ERR_OTHER;
                snprintf(c->errstr,sizeof(c->errstr),"%s",((redisReply*)reply)->str);
                __redisAsyncDisconnect(ac);
                return;
            }
            /* No more regular callbacks and no errors, the context *must* be subscribed. */
            assert(c->flags & REDIS_SUBSCRIBED);
            __redisGetSubscribeCallback(ac,reply,&cb);
        }

        if (cb.fn != NULL) {
            __redisRunCallback(ac,&cb,reply);
            c->reader->fn->freeObject(reply);

            /* Proceed with free'ing when redisAsyncFree() was called. */
            if (c->flags & REDIS_FREEING) {
                __redisAsyncFree(ac);
                return;
            }
        } else {
            /* No callback for this reply. This can either be a NULL callback,
             * or there were no callbacks to begin with. Either way, don't
             * abort with an error, but simply ignore it because the client
             * doesn't know what the server will spit out over the wire. */
            c->reader->fn->freeObject(reply);
        }
    }

    /* Disconnect when there was an error reading the reply */
    if (status != REDIS_OK)
        __redisAsyncDisconnect(ac);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2430
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jne 0x7f82
cmpq $0x0, -0x30(%rbp)
jne 0x7e57
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x7e52
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rdi
callq 0x77c0
cmpq $0x0, %rax
jne 0x7e52
movq -0x8(%rbp), %rdi
callq 0x7d50
jmp 0x7f91
jmp 0x7f82
movq -0x8(%rbp), %rdi
addq $0xf8, %rdi
leaq -0x28(%rbp), %rsi
callq 0x7fa0
cmpl $0x0, %eax
je 0x7f0e
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x7eca
movq -0x30(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x7eca
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x80, %esi
leaq 0x21a8(%rip), %rdx      # 0xa05d
movb $0x0, %al
callq 0x2180
movq -0x8(%rbp), %rdi
callq 0x7d50
jmp 0x7f91
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7ede
jmp 0x7efd
leaq 0x26b9(%rip), %rdi      # 0xa59e
leaq 0x26ce(%rip), %rsi      # 0xa5ba
movl $0x18e, %edx            # imm = 0x18E
leaq 0x26d2(%rip), %rcx      # 0xa5ca
callq 0x21b0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x8040
cmpq $0x0, -0x20(%rbp)
je 0x7f61
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rsi
callq 0x8270
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x128(%rax), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x7f5f
movq -0x8(%rbp), %rdi
callq 0x7b20
jmp 0x7f91
jmp 0x7f7d
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x128(%rax), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rdi
callq *%rax
jmp 0x7dfc
cmpl $0x0, -0x34(%rbp)
je 0x7f91
movq -0x8(%rbp), %rdi
callq 0x7d50
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)