// File: /workspace/github_c_makefile_star2_O0/andyfighting[P]hiredis_timer_cmpt/async.c
// Function: redisProcessCallbacks
void redisProcessCallbacks(redisAsyncContext *ac) {
    redisContext *c = &(ac->c);
    redisCallback cb = {NULL, NULL, NULL};
    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
                && ac->replies.head == NULL) {
                __redisAsyncDisconnect(ac);
                return;
            }

            /* If monitor mode, repush callback */
            if(c->flags & REDIS_MONITORING) {
                __redisPushCallback(&ac->replies,&cb);
            }

            /* 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 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.
             *
             * Another possibility is that the server is loading its dataset.
             * In this case we also want to close the connection, and have the
             * user wait until the server is ready to take our request.
             */
            if (((redisReply*)reply)->type == REDIS_REPLY_ERROR) {
                c->err = REDIS_ERR_OTHER;
                snprintf(c->errstr,sizeof(c->errstr),"%s",((redisReply*)reply)->str);
                c->reader->fn->freeObject(reply);
                __redisAsyncDisconnect(ac);
                return;
            }
            /* No more regular callbacks and no errors, the context *must* be subscribed or monitoring. */
            assert((c->flags & REDIS_SUBSCRIBED || c->flags & REDIS_MONITORING));
            if(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)
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x34f0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jne 0x9a56
cmpq $0x0, -0x30(%rbp)
jne 0x98fb
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x98d0
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rdi
callq 0x90f0
cmpq $0x0, %rax
jne 0x98d0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x128(%rax)
jne 0x98d0
movq -0x8(%rbp), %rdi
callq 0x97b0
jmp 0x9a65
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x98f6
movq -0x8(%rbp), %rdi
addq $0x128, %rdi            # imm = 0x128
leaq -0x28(%rbp), %rsi
callq 0x9a70
jmp 0x9a56
movq -0x8(%rbp), %rdi
addq $0x128, %rdi            # imm = 0x128
leaq -0x28(%rbp), %rsi
callq 0x9b20
cmpl $0x0, %eax
je 0x99e2
movq -0x30(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x9978
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 0x3716(%rip), %rdx      # 0xd05d
movb $0x0, %al
callq 0x3190
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x220(%rax), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rdi
callq *%rax
movq -0x8(%rbp), %rdi
callq 0x97b0
jmp 0x9a65
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x999c
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x999e
jmp 0x99bd
leaq 0x3c16(%rip), %rdi      # 0xd5bb
leaq 0x3c4c(%rip), %rsi      # 0xd5f8
movl $0x1cf, %edx            # imm = 0x1CF
leaq 0x3c48(%rip), %rcx      # 0xd600
callq 0x31c0
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x99e0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x9bc0
jmp 0x99e2
cmpq $0x0, -0x20(%rbp)
je 0x9a35
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rsi
callq 0x9df0
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x220(%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 0x9a33
movq -0x8(%rbp), %rdi
callq 0x9580
jmp 0x9a65
jmp 0x9a51
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq 0x220(%rax), %rax
movq 0x20(%rax), %rax
movq -0x30(%rbp), %rdi
callq *%rax
jmp 0x986c
cmpl $0x0, -0x34(%rbp)
je 0x9a65
movq -0x8(%rbp), %rdi
callq 0x97b0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)