// File: /workspace/github_c_makefile_star2_O3/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 0xb5905(%rip), %rax     # 0x102310
movq 0x20(%rax), %rdx
callq 0x41b2b
testq %rax, %rax
je 0x4cb64
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x40d47
testl %eax, %eax
jne 0x4cb64
testq %r12, %r12
je 0x4cacf
movq %r13, 0x8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x4c4e8
movq %rax, %r13
leaq 0x10(%rsp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x4c580
testl %eax, %eax
je 0x4cb40
movq %r15, %rdi
movq %r12, %rsi
callq 0x4c6e8
testl %eax, %eax
je 0x4ca5d
leaq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
callq 0x4c62e
movq 0x10(%r13), %rdi
callq 0x38413
movq %r13, %rdi
callq 0x38413
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 0x6fb01(%rip), %rsi     # 0xbc5c9
movl $0x10, %edi
jmp 0x4cb18
testl %ebp, %ebp
leaq 0x6fb0a(%rip), %rax     # 0xbc5e2
leaq 0x6fad6(%rip), %r15     # 0xbc5b5
cmoveq %rax, %r15
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x4c380
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
movl $0x10, %edi
movq %r15, %rsi
callq 0x7c665
leaq 0xb4d84(%rip), %rax     # 0x1018a8
incq 0x720(%rax)
movq %r14, %rdi
callq 0x4c4aa
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d23f
jmp 0x4cb64
movq 0x10(%r13), %rdi
callq 0x38413
movq %r13, %rdi
callq 0x38413
leaq 0xb57b8(%rip), %rax     # 0x102310
movq 0x30(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq