// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x88(%rax), %eax
andl $0xc, %eax
cmpl $0x0, %eax
je 0xa185
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa3fa
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0xacb0
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0xa1b3
jmp 0xa1d2
leaq 0x35dc(%rip), %rdi      # 0xd796
leaq 0x3437(%rip), %rsi      # 0xd5f8
movl $0x25a, %edx            # imm = 0x25A
leaq 0x35d3(%rip), %rcx      # 0xd7a0
callq 0x31c0
movq -0x80(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x24, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x58(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %edi
callq 0x3320
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x70, %edx
cmovel %ecx, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %ecx
movq -0x60(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movslq -0x54(%rbp), %rcx
movq -0x70(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x70(%rbp)
cmpl $0x0, -0x58(%rbp)
je 0xa2f8
movq -0x60(%rbp), %rdi
leaq 0x35c6(%rip), %rsi      # 0xd800
movl $0xb, %edx
callq 0x3360
cmpl $0x0, %eax
jne 0xa2f8
movq -0x38(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x88(%rax)
movq -0x80(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0xacb0
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0xa2f3
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x32c0
movq %rax, -0x88(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0xa2b8
movq -0x10(%rbp), %rax
movq 0x150(%rax), %rdi
movq -0x88(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0xad90
movl %eax, -0x8c(%rbp)
jmp 0xa2d9
movq -0x10(%rbp), %rax
movq 0x148(%rax), %rdi
movq -0x88(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0xad90
movl %eax, -0x8c(%rbp)
cmpl $0x0, -0x8c(%rbp)
jne 0xa2ee
movq -0x88(%rbp), %rdi
callq 0x3280
jmp 0xa260
jmp 0xa3ba
movq -0x60(%rbp), %rdi
leaq 0x34fb(%rip), %rsi      # 0xd7fe
movl $0xd, %edx
callq 0x3360
cmpl $0x0, %eax
jne 0xa335
movq -0x38(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0xa330
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa3fa
jmp 0xa3b8
movq -0x60(%rbp), %rdi
leaq 0x34cc(%rip), %rsi      # 0xd80c
movl $0x9, %edx
callq 0x3360
cmpl $0x0, %eax
jne 0xa378
movq -0x38(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x88(%rax)
movq -0x10(%rbp), %rdi
addq $0x128, %rdi            # imm = 0x128
leaq -0x50(%rbp), %rsi
callq 0x9a70
jmp 0xa3b6
movq -0x38(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xa3a0
movq -0x10(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
leaq -0x50(%rbp), %rsi
callq 0x9a70
jmp 0xa3b4
movq -0x10(%rbp), %rdi
addq $0x128, %rdi            # imm = 0x128
leaq -0x50(%rbp), %rsi
callq 0x9a70
jmp 0xa3b6
jmp 0xa3b8
jmp 0xa3ba
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x3560
movq -0x10(%rbp), %rax
cmpq $0x0, 0x100(%rax)
je 0xa3f1
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xe8(%rcx), %rdi
callq *%rax
jmp 0xa3f3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)