// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x11f2d8(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rdx
callq 0x4a780
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x59992
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x1, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x59997
jmp 0x59b2e
cmpq $0x0, -0x10(%rbp)
je 0x59a87
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x591a0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x592a0
cmpl $0x0, %eax
je 0x599f7
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x594b0
cmpl $0x0, %eax
je 0x599f5
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
leaq -0x68(%rbp), %rdi
callq 0x593e0
movl $0x1, -0x6c(%rbp)
jmp 0x599f7
jmp 0x599b8
movq -0x30(%rbp), %rdi
callq 0x59270
cmpl $0x0, -0x6c(%rbp)
je 0x59a69
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4aa60
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x10, %edi
leaq 0xddaf7(%rip), %rsi     # 0x137539
callq 0x9ce20
leaq 0x11e78a(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x11e778(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
jmp 0x59a82
movq -0x8(%rbp), %rdi
leaq 0x11f1cc(%rip), %rax    # 0x178c40
movq 0x30(%rax), %rsi
callq 0x42cc0
jmp 0x59b2e
jmp 0x59b11
movl -0x1c(%rbp), %edx
leaq 0xdda94(%rip), %rax     # 0x137525
leaq 0xddaba(%rip), %rcx     # 0x137552
cmpl $0x0, %edx
cmoveq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x58f20
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4aa60
movq -0x78(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x10, %edi
callq 0x9ce20
leaq 0x11e6e0(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x11e6ce(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rdi
callq 0x59140
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x43780
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)