// File: /workspace/github_c_makefile_star2_O1/andyfighting[P]hiredis_timer_cmpt/async.c
// Function: _redisAsyncCommand
static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *cmd, size_t len) {
    redisContext *c = &(ac->c);
    redisCallback cb;
    int pvariant, hasnext;
    const char *cstr, *astr;
    size_t clen, alen;
    const char *p;
    sds sname;
    int ret;

    /* Don't accept new commands when the connection is about to be closed. */
    if (c->flags & (REDIS_DISCONNECTING | REDIS_FREEING)) return REDIS_ERR;

    /* Setup callback */
    cb.fn = fn;
    cb.privdata = privdata;

    /* Find out which command will be appended. */
    p = nextArgument(cmd,&cstr,&clen);
    assert(p != NULL);
    hasnext = (p[0] == '$');
    pvariant = (tolower(cstr[0]) == 'p') ? 1 : 0;
    cstr += pvariant;
    clen -= pvariant;

    if (hasnext && strncasecmp(cstr,"subscribe\r\n",11) == 0) {
        c->flags |= REDIS_SUBSCRIBED;

        /* Add every channel/pattern to the list of subscription callbacks. */
        while ((p = nextArgument(p,&astr,&alen)) != NULL) {
            sname = sdsnewlen(astr,alen);
            if (pvariant)
                ret = dictReplace(ac->sub.patterns,sname,&cb);
            else
                ret = dictReplace(ac->sub.channels,sname,&cb);

            if (ret == 0) sdsfree(sname);
        }
    } else if (strncasecmp(cstr,"unsubscribe\r\n",13) == 0) {
        /* It is only useful to call (P)UNSUBSCRIBE when the context is
         * subscribed to one or more channels or patterns. */
        if (!(c->flags & REDIS_SUBSCRIBED)) return REDIS_ERR;

        /* (P)UNSUBSCRIBE does not have its own response: every channel or
         * pattern that is unsubscribed will receive a message. This means we
         * should not append a callback function for this command. */
     } else if(strncasecmp(cstr,"monitor\r\n",9) == 0) {
         /* Set monitor flag and push callback */
         c->flags |= REDIS_MONITORING;
         __redisPushCallback(&ac->replies,&cb);
    } else {
        if (c->flags & REDIS_SUBSCRIBED)
            /* This will likely result in an error reply, but it needs to be
             * received and passed to the callback. */
            __redisPushCallback(&ac->sub.invalid,&cb);
        else
            __redisPushCallback(&ac->replies,&cb);
    }

    __redisAppendCommand(c,cmd,len);

    /* Always schedule a write when the write buffer is non-empty */
    _EL_ADD_WRITE(ac);

    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb $0xc, 0x88(%rdi)
jne 0x7df3
movq %rdi, %rbx
movq %r8, 0x20(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rcx, 0x18(%rsp)
movq %rcx, %rdi
callq 0x8132
testq %rax, %rax
je 0x7e85
movq %rax, %r13
movb (%rax), %r15b
callq 0x3510
movq (%rax), %rax
movq 0x10(%rsp), %r12
movsbq (%r12), %rcx
movl (%rax,%rcx,4), %r14d
xorl %eax, %eax
cmpl $0x70, %r14d
sete %al
subq %rax, 0x28(%rsp)
addq %rax, %r12
movq %r12, 0x10(%rsp)
cmpb $0x24, %r15b
jne 0x7d60
leaq 0x1a0a(%rip), %rsi      # 0x9755
movl $0xb, %edx
movq %r12, %rdi
callq 0x3350
testl %eax, %eax
je 0x7e04
leaq 0x19ec(%rip), %rsi      # 0x9753
movl $0xd, %edx
movq %r12, %rdi
callq 0x3350
testl %eax, %eax
je 0x7da4
leaq 0x19e2(%rip), %rsi      # 0x9761
movl $0x9, %edx
movq %r12, %rdi
callq 0x3350
movl 0x88(%rbx), %edi
testl %eax, %eax
je 0x7daf
andl $0x20, %edi
shrl %edi
orq $0x128, %rdi            # imm = 0x128
jmp 0x7dbd
testb $0x20, 0x88(%rbx)
jne 0x7dca
jmp 0x7df3
orl $0x40, %edi
movl %edi, 0x88(%rbx)
movl $0x128, %edi            # imm = 0x128
addq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x7ac0
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x3550
movq 0x100(%rbx), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x7df3
movq 0xe8(%rbx), %rdi
callq *%rax
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
orb $0x20, 0x88(%rbx)
leaq 0x8(%rsp), %rsi
movq %rsp, %rdx
movq %r13, %rdi
callq 0x8132
testq %rax, %rax
je 0x7dca
movq %rax, %r12
xorl %eax, %eax
cmpl $0x70, %r14d
sete %al
leaq 0x148(,%rax,8), %r13
leaq 0x8(%rsp), %rbp
movq %rsp, %r14
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x32c0
movq %rax, %r15
movq (%rbx,%r13), %rdi
movq %rax, %rsi
leaq 0x30(%rsp), %rdx
callq 0x81c2
testl %eax, %eax
jne 0x7e6a
movq %r15, %rdi
callq 0x3280
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x8132
movq %rax, %r12
testq %rax, %rax
jne 0x7e3c
jmp 0x7dca
leaq 0x185f(%rip), %rdi      # 0x96eb
leaq 0x16ba(%rip), %rsi      # 0x954d
leaq 0x185b(%rip), %rcx      # 0x96f5
movl $0x25a, %edx            # imm = 0x25A
callq 0x31b0