// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
callq 0x2440
testl %eax, %eax
je 0x59ed
movq %rbx, %rdi
callq 0x5937
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %r14
movq 0x8(%rsp), %r13
testq %r13, %r13
je 0x5cb4
movq 0xf8(%rbx), %rdi
testq %rdi, %rdi
je 0x5a33
movq (%rdi), %rax
movq %rax, 0xf8(%rbx)
cmpq 0x100(%rbx), %rdi
jne 0x5ba1
movq $0x0, 0x100(%rbx)
jmp 0x5ba1
testb $0x20, 0x88(%rbx)
movl (%r13), %eax
je 0x5ce4
cmpl $0x2, %eax
jne 0x5b77
cmpq $0x1, 0x20(%r13)
jbe 0x5d13
movq %r12, 0x18(%rsp)
movq 0x28(%r13), %rbp
movq (%rbp), %rax
cmpl $0x1, (%rax)
jne 0x5d32
movq 0x18(%rax), %r14
callq 0x2460
movq (%rax), %rax
movsbq (%r14), %rcx
movl (%rax,%rcx,4), %r12d
xorl %eax, %eax
cmpl $0x70, %r12d
sete %dl
movq 0x8(%rbp), %rcx
cmpl $0x1, (%rcx)
jne 0x5d51
movb %dl, %al
movq 0x118(%rbx,%rax,8), %rbp
movq 0x18(%rcx), %rdi
movslq 0x10(%rcx), %rsi
callq 0x22a0
movq %rbp, %rdi
movq %rax, 0x10(%rsp)
movq %rax, %rsi
callq 0x6319
testq %rax, %rax
je 0x5c9b
xorl %ecx, %ecx
cmpl $0x70, %r12d
sete %cl
movq 0x8(%rax), %rax
movq 0x8(%rax), %r15
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
addq %rcx, %r14
movq %r14, %rdi
leaq 0x1bd8(%rip), %rsi      # 0x76c7
callq 0x2070
testl %eax, %eax
jne 0x5c9b
cmpq $0x0, 0x10(%rbp)
je 0x5c7c
movq 0x8(%rbp), %rax
movq 0x10(%rsp), %rdi
callq *(%rax)
andl 0x18(%rbp), %eax
movq (%rbp), %rcx
movq %rax, 0x20(%rsp)
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x5c7c
xorl %r14d, %r14d
movq %rax, %r12
movq 0x8(%rbp), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x5b56
movq 0x28(%rbp), %rdi
movq (%r12), %rdx
movq 0x10(%rsp), %rsi
callq *%rax
testl %eax, %eax
je 0x5b65
jmp 0x5c21
movq 0x10(%rsp), %rax
cmpq %rax, (%r12)
je 0x5c21
movq 0x10(%r12), %rax
movq %r12, %r14
testq %rax, %rax
jne 0x5b2e
jmp 0x5c7c
movq 0x108(%rbx), %rdi
testq %rdi, %rdi
je 0x5bae
movq (%rdi), %rax
movq %rax, 0x108(%rbx)
cmpq 0x110(%rbx), %rdi
jne 0x5ba1
movq $0x0, 0x110(%rbx)
movq 0x8(%rdi), %r15
movq 0x10(%rdi), %r12
callq 0x2060
testq %r15, %r15
je 0x5bf3
movq 0x8(%rsp), %rsi
orl $0x10, 0x88(%rbx)
movq %rbx, %rdi
movq %r12, %rdx
callq *%r15
andb $-0x11, 0x88(%rbx)
movq 0x98(%rbx), %rax
movq 0x128(%rax), %rax
movq 0x8(%rsp), %rdi
callq *0x20(%rax)
testb $0x8, 0x88(%rbx)
je 0x5c09
jmp 0x5cd7
movq 0x98(%rbx), %rax
movq 0x128(%rax), %rax
movq 0x8(%rsp), %rdi
callq *0x20(%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2440
testl %eax, %eax
je 0x59f2
jmp 0x59d6
testq %r14, %r14
je 0x5c2c
addq $0x10, %r14
jmp 0x5c39
movq 0x20(%rsp), %r14
shlq $0x3, %r14
addq (%rbp), %r14
movq 0x10(%r12), %rax
movq %rax, (%r14)
movq 0x8(%rbp), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x5c5c
movq 0x28(%rbp), %rdi
movq (%r12), %rsi
callq *%rax
movq 0x8(%rbp), %rcx
movq 0x28(%rcx), %rax
testq %rax, %rax
je 0x5c70
movq 0x28(%rbp), %rdi
movq 0x8(%r12), %rsi
callq *%rax
movq %r12, %rdi
callq 0x2060
decq 0x20(%rbp)
movq 0x28(%r13), %rax
movq 0x10(%rax), %rax
cmpl $0x3, (%rax)
jne 0x5d70
cmpq $0x0, 0x8(%rax)
jne 0x5c9b
andb $-0x21, 0x88(%rbx)
movq 0x10(%rsp), %rdi
callq 0x2260
leaq 0x8(%rsp), %r14
movq 0x18(%rsp), %r12
jmp 0x5bae
testb $0x4, 0x88(%rbx)
je 0x59de
movq 0x90(%rbx), %rax
cmpl $0x0, -0x8(%rax)
jne 0x59de
jmp 0x59d6
movq %rbx, %rdi
callq 0x5711
jmp 0x59de
cmpl $0x6, %eax
jne 0x5d8f
movl $0x2, (%rbx)
leaq 0x4(%rbx), %rdi
movq 0x18(%r13), %rcx
leaq 0x135b(%rip), %rdx      # 0x705d
movl $0x80, %esi
xorl %eax, %eax
callq 0x2180
jmp 0x59d6
leaq 0x18e8(%rip), %rdi      # 0x7602
leaq 0x183b(%rip), %rsi      # 0x755c
leaq 0x18ef(%rip), %rcx      # 0x7617
movl $0x145, %edx            # imm = 0x145
callq 0x21b0
leaq 0x1932(%rip), %rdi      # 0x766b
leaq 0x181c(%rip), %rsi      # 0x755c
leaq 0x18d0(%rip), %rcx      # 0x7617
movl $0x146, %edx            # imm = 0x146
callq 0x21b0
leaq 0x1941(%rip), %rdi      # 0x7699
leaq 0x17fd(%rip), %rsi      # 0x755c
leaq 0x18b1(%rip), %rcx      # 0x7617
movl $0x150, %edx            # imm = 0x150
callq 0x21b0
leaq 0x195c(%rip), %rdi      # 0x76d3
leaq 0x17de(%rip), %rsi      # 0x755c
leaq 0x1892(%rip), %rcx      # 0x7617
movl $0x15c, %edx            # imm = 0x15C
callq 0x21b0
leaq 0x17aa(%rip), %rdi      # 0x7540
leaq 0x17bf(%rip), %rsi      # 0x755c
leaq 0x17c8(%rip), %rcx      # 0x756c
movl $0x18e, %edx            # imm = 0x18E
callq 0x21b0