// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/t_list.c
// Function: pushxGenericCommand
void pushxGenericCommand(client *c, robj *refval, robj *val, int where) {
    robj *subject;
    listTypeIterator *iter;
    listTypeEntry entry;
    int inserted = 0;

    if ((subject = lookupKeyWriteOrReply(c,c->argv[1],shared.czero)) == NULL ||
        checkType(c,subject,OBJ_LIST)) return;

    if (refval != NULL) {
        /* Seek refval from head to tail */
        iter = listTypeInitIterator(subject,0,LIST_TAIL);
        while (listTypeNext(iter,&entry)) {
            if (listTypeEqual(&entry,refval)) {
                listTypeInsert(&entry,val,where);
                inserted = 1;
                break;
            }
        }
        listTypeReleaseIterator(iter);

        if (inserted) {
            signalModifiedKey(c->db,c->argv[1]);
            notifyKeyspaceEvent(NOTIFY_LIST,"linsert",
                                c->argv[1],c->db->id);
            server.dirty++;
        } else {
            /* Notify client of a failed insert */
            addReply(c,shared.cnegone);
            return;
        }
    } else {
        char *event = (where == LIST_HEAD) ? "lpush" : "rpush";

        listTypePush(subject,val,where);
        signalModifiedKey(c->db,c->argv[1]);
        notifyKeyspaceEvent(NOTIFY_LIST,event,c->argv[1],c->db->id);
        server.dirty++;
    }

    addReplyLongLong(c,listTypeLength(subject));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rsi
leaq 0xb5bbe(%rip), %rax     # 0xfa310
movq 0x20(%rax), %rdx
callq 0x3af15
testq %rax, %rax
je 0x44891
movq %rax, %r14
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a311
testl %eax, %eax
jne 0x44891
testq %r12, %r12
je 0x44807
movq %r13, 0x8(%rsp)
pushq $0x1
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x442b8
movq %rax, %r13
leaq 0x10(%rsp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x44347
testl %eax, %eax
je 0x44876
movq %r15, %rdi
movq %r12, %rsi
callq 0x44482
testl %eax, %eax
je 0x447a0
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
callq 0x443ed
movq %r13, %rdi
callq 0x44331
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x3b125
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
leaq 0x69cb7(%rip), %rsi     # 0xae4b9
pushq $0x10
popq %rdi
jmp 0x4484e
testl %ebp, %ebp
leaq 0x69cc2(%rip), %rax     # 0xae4d2
leaq 0x69c8e(%rip), %r15     # 0xae4a5
cmoveq %rax, %r15
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x4414c
movq 0x10(%rbx), %rdi
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
callq 0x3b125
movq 0x10(%rbx), %rax
movq 0x40(%rbx), %rcx
movq 0x8(%rcx), %rdx
movl 0x30(%rax), %ecx
pushq $0x10
popq %rdi
movq %r15, %rsi
callq 0x6fb58
leaq 0xb504e(%rip), %rax     # 0xf98a8
incq 0x720(%rax)
movq %r14, %rdi
callq 0x4427e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x370a6
jmp 0x44891
movq %r13, %rdi
callq 0x44331
leaq 0xb5a8b(%rip), %rax     # 0xfa310
movq 0x30(%rax), %rsi
movq %rbx, %rdi
callq 0x36987
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq