// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/pubsub.c
// Function: pubsubPublishMessage
int pubsubPublishMessage(robj *channel, robj *message) {
    int receivers = 0;
    dictEntry *de;
    listNode *ln;
    listIter li;

    /* Send to clients listening for that channel */
    de = dictFind(server.pubsub_channels,channel);
    if (de) {
        list *list = dictGetVal(de);
        listNode *ln;
        listIter li;

        listRewind(list,&li);
        while ((ln = listNext(&li)) != NULL) {
            client *c = ln->value;

            addReply(c,shared.mbulkhdr[3]);
            addReply(c,shared.messagebulk);
            addReplyBulk(c,channel);
            addReplyBulk(c,message);
            receivers++;
        }
    }
    /* Send to clients listening to matching channels */
    if (listLength(server.pubsub_patterns)) {
        listRewind(server.pubsub_patterns,&li);
        channel = getDecodedObject(channel);
        while ((ln = listNext(&li)) != NULL) {
            pubsubPattern *pat = ln->value;

            if (stringmatchlen((char*)pat->pattern->ptr,
                                sdslen(pat->pattern->ptr),
                                (char*)channel->ptr,
                                sdslen(channel->ptr),0)) {
                addReply(pat->client,shared.mbulkhdr[4]);
                addReply(pat->client,shared.pmessagebulk);
                addReplyBulk(pat->client,pat->pattern);
                addReplyBulk(pat->client,channel);
                addReplyBulk(pat->client,message);
                receivers++;
            }
        }
        decrRefCount(channel);
    }
    return receivers;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq 0x103217(%rip), %rax    # 0x1781d8
movq 0x988(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x2dcb0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7506d
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x27320
leaq -0x58(%rbp), %rdi
callq 0x27380
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x7506b
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
leaq 0x103c1d(%rip), %rax    # 0x178c40
movq 0x13a48(%rax), %rsi
callq 0x42cc0
movq -0x60(%rbp), %rdi
leaq 0x103c06(%rip), %rax    # 0x178c40
movq 0xf8(%rax), %rsi
callq 0x42cc0
movq -0x60(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x43630
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x43630
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x74ff9
jmp 0x7506d
leaq 0x103164(%rip), %rax    # 0x1781d8
movq 0x990(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x751a3
leaq 0x10314b(%rip), %rax    # 0x1781d8
movq 0x990(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x27320
movq -0x8(%rbp), %rdi
callq 0x494f0
movq %rax, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x27380
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x7519a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x751b0
movl %eax, -0x74(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x751b0
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %esi
movq -0x70(%rbp), %rdx
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x46ef0
cmpl $0x0, %eax
je 0x75195
movq -0x68(%rbp), %rax
movq (%rax), %rdi
leaq 0x103b0e(%rip), %rax    # 0x178c40
movq 0x13a50(%rax), %rsi
callq 0x42cc0
movq -0x68(%rbp), %rax
movq (%rax), %rdi
leaq 0x103af4(%rip), %rax    # 0x178c40
movq 0x100(%rax), %rsi
callq 0x42cc0
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x43630
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x43630
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x43630
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x750aa
movq -0x8(%rbp), %rdi
callq 0x48f70
movl -0x14(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nop