// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rdi, %rbx
movq %rsp, %r14
andq $0x0, (%r14)
leaq 0xf8(%rdi), %r13
leaq 0x108(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0x20(%rsp), %r12
movq %r13, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2440
testl %eax, %eax
jne 0x55c6
cmpq $0x0, (%rsp)
je 0x5584
movq %r13, %rdi
movq %r12, %rsi
callq 0x5682
testl %eax, %eax
je 0x552f
testb $0x20, 0x88(%rbx)
movq (%rsp), %r15
movl (%r15), %eax
je 0x559c
cmpl $0x2, %eax
jne 0x548f
cmpq $0x1, 0x20(%r15)
jbe 0x55e7
movq 0x28(%r15), %r12
movq (%r12), %rax
cmpl $0x1, (%rax)
jne 0x5606
movq 0x18(%rax), %r14
callq 0x2460
movq (%rax), %rax
movsbq (%r14), %rcx
movl (%rax,%rcx,4), %r13d
xorl %eax, %eax
cmpl $0x70, %r13d
sete %dl
movq 0x8(%r12), %rcx
cmpl $0x1, (%rcx)
jne 0x5625
movb %dl, %al
movq 0x118(%rbx,%rax,8), %r12
movq 0x18(%rcx), %rdi
movslq 0x10(%rcx), %rsi
callq 0x22a0
movq %rax, %rbp
movq %r12, %rdi
movq %rax, %rsi
callq 0x5c56
testq %rax, %rax
je 0x551a
xorl %ecx, %ecx
cmpl $0x70, %r13d
sete %cl
movq 0x8(%rax), %rax
movq 0x10(%rax), %rdx
movq %rdx, 0x30(%rsp)
movups (%rax), %xmm0
movaps %xmm0, 0x20(%rsp)
addq %rcx, %r14
movq %r14, %rdi
leaq 0x22a8(%rip), %rsi      # 0x76c1
callq 0x2070
testl %eax, %eax
jne 0x551a
cmpq $0x0, 0x10(%r12)
je 0x54fb
movq 0x8(%r12), %rax
movq %rbp, %rdi
callq *(%rax)
andl 0x18(%r12), %eax
shlq $0x3, %rax
movq (%r12), %rcx
movq %rax, 0x8(%rsp)
addq %rax, %rcx
xorl %r13d, %r13d
movq (%rcx), %r14
testq %r14, %r14
je 0x54fb
movq 0x8(%r12), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x5481
movq 0x28(%r12), %rdi
movq (%r14), %rdx
movq %rbp, %rsi
callq *%rax
testl %eax, %eax
je 0x5486
jmp 0x54a1
cmpq %rbp, (%r14)
je 0x54a1
leaq 0x10(%r14), %rcx
movq %r14, %r13
jmp 0x5454
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x5682
jmp 0x552f
testq %r13, %r13
je 0x54ac
addq $0x10, %r13
jmp 0x54b5
movq 0x8(%rsp), %r13
addq (%r12), %r13
movq 0x10(%r14), %rax
movq %rax, (%r13)
movq 0x8(%r12), %rcx
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x54da
movq 0x28(%r12), %rdi
movq (%r14), %rsi
callq *%rax
movq 0x8(%r12), %rcx
movq 0x28(%rcx), %rax
testq %rax, %rax
je 0x54ee
movq 0x28(%r12), %rdi
movq 0x8(%r14), %rsi
callq *%rax
movq %r14, %rdi
callq 0x2060
decq 0x20(%r12)
movq 0x28(%r15), %rax
movq 0x10(%rax), %rax
cmpl $0x3, (%rax)
jne 0x5644
cmpq $0x0, 0x8(%rax)
jne 0x551a
andb $-0x21, 0x88(%rbx)
movq %rbp, %rdi
callq 0x2260
movq %rsp, %r14
movq 0x10(%rsp), %r13
leaq 0x20(%rsp), %r12
cmpq $0x0, 0x28(%rsp)
je 0x556a
movq (%rsp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x56c2
movq 0x98(%rbx), %rax
movq 0x128(%rax), %rax
movq (%rsp), %rdi
callq *0x20(%rax)
testb $0x8, 0x88(%rbx)
je 0x532b
jmp 0x55d0
movq 0x98(%rbx), %rax
movq 0x128(%rax), %rax
movq (%rsp), %rdi
callq *0x20(%rax)
jmp 0x532b
testb $0x4, 0x88(%rbx)
je 0x55d8
movq 0x90(%rbx), %rax
cmpl $0x0, -0x8(%rax)
jne 0x55d8
jmp 0x55c6
cmpl $0x6, %eax
jne 0x5663
movl $0x2, (%rbx)
leaq 0x4(%rbx), %rdi
movq 0x18(%r15), %rcx
leaq 0x1aa3(%rip), %rdx      # 0x705d
movl $0x80, %esi
xorl %eax, %eax
callq 0x2180
movq %rbx, %rdi
callq 0x5297
jmp 0x55d8
movq %rbx, %rdi
callq 0x5143
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x200e(%rip), %rdi      # 0x75fc
leaq 0x1f61(%rip), %rsi      # 0x7556
leaq 0x2015(%rip), %rcx      # 0x7611
movl $0x145, %edx            # imm = 0x145
callq 0x21b0
leaq 0x2058(%rip), %rdi      # 0x7665
leaq 0x1f42(%rip), %rsi      # 0x7556
leaq 0x1ff6(%rip), %rcx      # 0x7611
movl $0x146, %edx            # imm = 0x146
callq 0x21b0
leaq 0x2067(%rip), %rdi      # 0x7693
leaq 0x1f23(%rip), %rsi      # 0x7556
leaq 0x1fd7(%rip), %rcx      # 0x7611
movl $0x150, %edx            # imm = 0x150
callq 0x21b0
leaq 0x2082(%rip), %rdi      # 0x76cd
leaq 0x1f04(%rip), %rsi      # 0x7556
leaq 0x1fb8(%rip), %rcx      # 0x7611
movl $0x15c, %edx            # imm = 0x15C
callq 0x21b0
leaq 0x1ed0(%rip), %rdi      # 0x753a
leaq 0x1ee5(%rip), %rsi      # 0x7556
leaq 0x1eee(%rip), %rcx      # 0x7566
movl $0x18e, %edx            # imm = 0x18E
callq 0x21b0