// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/pubsub.c
// Function: pubsubUnsubscribeChannel
int pubsubUnsubscribeChannel(client *c, robj *channel, int notify) {
    dictEntry *de;
    list *clients;
    listNode *ln;
    int retval = 0;

    /* Remove the channel from the client -> channels hash table */
    incrRefCount(channel); /* channel may be just a pointer to the same object
                            we have in the hash tables. Protect it... */
    if (dictDelete(c->pubsub_channels,channel) == DICT_OK) {
        retval = 1;
        /* Remove the client from the channel -> clients list hash table */
        de = dictFind(server.pubsub_channels,channel);
        serverAssertWithInfo(c,NULL,de != NULL);
        clients = dictGetVal(de);
        ln = listSearchKey(clients,c);
        serverAssertWithInfo(c,NULL,ln != NULL);
        listDelNode(clients,ln);
        if (listLength(clients) == 0) {
            /* Free the list and associated hash entry at all if this was
             * the latest client, so that it will be possible to abuse
             * Redis PUBSUB creating millions of channels. */
            dictDelete(server.pubsub_channels,channel);
        }
    }
    /* Notify the client */
    if (notify) {
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.unsubscribebulk);
        addReplyBulk(c,channel);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));

    }
    decrRefCount(channel); /* it is finally safe to release it */
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rdi
callq 0x487b0
movq -0x8(%rbp), %rax
movq 0x1a8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2de50
cmpl $0x0, %eax
jne 0x74ae8
movl $0x1, -0x34(%rbp)
leaq 0x1037ba(%rip), %rax    # 0x1781d8
movq 0x988(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2dcb0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x74a3b
jmp 0x74a66
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xc6fe7(%rip), %rdx     # 0x13ba31
leaq 0xcb747(%rip), %rcx     # 0x140198
movl $0x65, %r8d
callq 0x78360
movl $0x1, %edi
callq 0x263c0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x274d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x74a8c
jmp 0x74ab7
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xc6049(%rip), %rdx     # 0x13aae4
leaq 0xcb6f6(%rip), %rcx     # 0x140198
movl $0x68, %r8d
callq 0x78360
movl $0x1, %edi
callq 0x263c0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x271e0
movq -0x28(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x74ae6
leaq 0x103702(%rip), %rax    # 0x1781d8
movq 0x988(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2de50
jmp 0x74ae8
cmpl $0x0, -0x14(%rbp)
je 0x74b5f
movq -0x8(%rbp), %rdi
leaq 0x104147(%rip), %rax    # 0x178c40
movq 0x13a48(%rax), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rdi
leaq 0x104130(%rip), %rax    # 0x178c40
movq 0x110(%rax), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x43630
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x1a8(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x1a8(%rax), %rax
addq 0x48(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x1b0(%rax), %rax
addq 0x28(%rax), %rsi
callq 0x43780
movq -0x10(%rbp), %rdi
callq 0x48f70
movl -0x34(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)