// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: pfaddCommand
void pfaddCommand(client *c) {
    robj *o = lookupKeyWrite(c->db,c->argv[1]);
    struct hllhdr *hdr;
    int updated = 0, j;

    if (o == NULL) {
        /* Create the key with a string value of the exact length to
         * hold our HLL data structure. sdsnewlen() when NULL is passed
         * is guaranteed to return bytes initialized to zero. */
        o = createHLLObject();
        dbAdd(c->db,c->argv[1],o);
        updated++;
    } else {
        if (isHLLObjectOrReply(c,o) != C_OK) return;
        o = dbUnshareStringValue(c->db,c->argv[1],o);
    }
    /* Perform the low level ADD operation for every element. */
    for (j = 2; j < c->argc; j++) {
        int retval = hllAdd(o, (unsigned char*)c->argv[j]->ptr,
                               sdslen(c->argv[j]->ptr));
        switch(retval) {
        case 1:
            updated++;
            break;
        case -1:
            addReplySds(c,sdsnew(invalid_hll_err));
            return;
        }
    }
    hdr = o->ptr;
    if (updated) {
        signalModifiedKey(c->db,c->argv[1]);
        notifyKeyspaceEvent(NOTIFY_STRING,"pfadd",c->argv[1],c->db->id);
        server.dirty++;
        HLL_INVALIDATE_CACHE(hdr);
    }
    addReply(c, updated ? shared.cone : shared.czero);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41ad6
testq %rax, %rax
je 0x7df78
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7dead
testl %eax, %eax
je 0x7df9b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x7de80
movq %rax, %r14
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdx
callq 0x41b77
movl $0x1, %ebp
jmp 0x7dfb4
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdx
callq 0x41f24
movq %rax, %r14
xorl %ebp, %ebp
cmpl $0x3, 0x38(%rbx)
jl 0x7e02a
movl $0x2, %r15d
leaq 0x4f99d(%rip), %r12     # 0xcd964
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x7e006
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x7e008
movq -0x11(%rsi), %rdx
jmp 0x7e008
movzwl -0x5(%rsi), %edx
jmp 0x7e008
movl -0x9(%rsi), %edx
jmp 0x7e008
movzbl -0x3(%rsi), %edx
jmp 0x7e008
xorl %edx, %edx
movq %r14, %rdi
callq 0x7dd2b
cmpl $0x1, %eax
je 0x7e01c
cmpl $-0x1, %eax
jne 0x7e01e
jmp 0x7e099
incl %ebp
incq %r15
movslq 0x38(%rbx), %rax
cmpq %rax, %r15
jl 0x7dfc7
testl %ebp, %ebp
je 0x7e076
movq 0x8(%r14), %r14
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x41d90
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x3e96b(%rip), %rsi     # 0xbc9c4
movl $0x8, %edi
callq 0x7c665
leaq 0x8383e(%rip), %rax     # 0x1018a8
incq 0x720(%rax)
orb $-0x80, 0xf(%r14)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x8428c(%rip), %rcx     # 0x102310
movq 0x20(%rcx,%rax,8), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3c854
leaq 0x4fb53(%rip), %rdi     # 0xcdbf3
callq 0x362b0
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3ca86