// File: /workspace/github_c_makefile_star2_O0/andyfighting[P]hiredis_timer_cmpt/async.c
// Function: _redisGetSubscribeCallback
static int __redisGetSubscribeCallback(redisAsyncContext *ac, redisReply *reply, redisCallback *dstcb) {
    redisContext *c = &(ac->c);
    dict *callbacks;
    dictEntry *de;
    int pvariant;
    char *stype;
    sds sname;

    /* Custom reply functions are not supported for pub/sub. This will fail
     * very hard when they are used... */
    if (reply->type == REDIS_REPLY_ARRAY) {
        assert(reply->elements >= 2);
        assert(reply->element[0]->type == REDIS_REPLY_STRING);
        stype = reply->element[0]->str;
        pvariant = (tolower(stype[0]) == 'p') ? 1 : 0;

        if (pvariant)
            callbacks = ac->sub.patterns;
        else
            callbacks = ac->sub.channels;

        /* Locate the right callback */
        assert(reply->element[1]->type == REDIS_REPLY_STRING);
        sname = sdsnewlen(reply->element[1]->str,reply->element[1]->len);
        de = dictFind(callbacks,sname);
        if (de != NULL) {
            memcpy(dstcb,dictGetEntryVal(de),sizeof(*dstcb));

            /* If this is an unsubscribe message, remove it. */
            if (strcasecmp(stype+pvariant,"unsubscribe") == 0) {
                dictDelete(callbacks,sname);

                /* If this was the last unsubscribe message, revert to
                 * non-subscribe mode. */
                assert(reply->element[2]->type == REDIS_REPLY_INTEGER);
                if (reply->element[2]->integer == 0)
                    c->flags &= ~REDIS_SUBSCRIBED;
            }
        }
        sdsfree(sname);
    } else {
        /* Shift callback for invalid commands. */
        __redisShiftCallback(&ac->sub.invalid,dstcb);
    }
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x9dc6
movq -0x10(%rbp), %rax
cmpq $0x2, 0x20(%rax)
jb 0x9bf6
jmp 0x9c15
leaq 0x3a99(%rip), %rdi      # 0xd696
leaq 0x39f4(%rip), %rsi      # 0xd5f8
movl $0x177, %edx            # imm = 0x177
leaq 0x3a9b(%rip), %rcx      # 0xd6ab
callq 0x31c0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x9c27
jmp 0x9c46
leaq 0x3ad1(%rip), %rdi      # 0xd6ff
leaq 0x39c3(%rip), %rsi      # 0xd5f8
movl $0x178, %edx            # imm = 0x178
leaq 0x3a6a(%rip), %rcx      # 0xd6ab
callq 0x31c0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %edi
callq 0x3320
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x70, %edx
cmovel %ecx, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x9c8e
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x9c9d
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x1, (%rax)
jne 0x9cb0
jmp 0x9ccf
leaq 0x3a76(%rip), %rdi      # 0xd72d
leaq 0x393a(%rip), %rsi      # 0xd5f8
movl $0x182, %edx            # imm = 0x182
leaq 0x39e1(%rip), %rcx      # 0xd6ab
callq 0x31c0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movslq 0x10(%rax), %rsi
callq 0x32c0
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xaa50
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x9dbb
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rdi
movslq -0x34(%rbp), %rax
addq %rax, %rdi
leaq 0x3a13(%rip), %rsi      # 0xd75b
callq 0x3050
cmpl $0x0, %eax
jne 0x9db9
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xab20
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x3, (%rax)
jne 0x9d72
jmp 0x9d91
leaq 0x39ee(%rip), %rdi      # 0xd767
leaq 0x3878(%rip), %rsi      # 0xd5f8
movl $0x18e, %edx            # imm = 0x18E
leaq 0x391f(%rip), %rcx      # 0xd6ab
callq 0x31c0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x8(%rax)
jne 0x9db7
movq -0x20(%rbp), %rax
movl 0x88(%rax), %ecx
andl $-0x21, %ecx
movl %ecx, 0x88(%rax)
jmp 0x9db9
jmp 0x9dbb
movq -0x48(%rbp), %rdi
callq 0x3280
jmp 0x9dda
movq -0x8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq -0x18(%rbp), %rsi
callq 0x9b20
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)