// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/t_list.c
// Function: lrangeCommand
void lrangeCommand(client *c) {
    robj *o;
    long start, end, llen, rangelen;

    if ((getLongFromObjectOrReply(c, c->argv[2], &start, NULL) != C_OK) ||
        (getLongFromObjectOrReply(c, c->argv[3], &end, NULL) != C_OK)) return;

    if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptymultibulk)) == NULL
         || checkType(c,o,OBJ_LIST)) return;
    llen = listTypeLength(o);

    /* convert negative indexes */
    if (start < 0) start = llen+start;
    if (end < 0) end = llen+end;
    if (start < 0) start = 0;

    /* Invariant: start >= 0, so this test will be true when end < 0.
     * The range is empty when start > end or start >= length. */
    if (start > end || start >= llen) {
        addReply(c,shared.emptymultibulk);
        return;
    }
    if (end >= llen) end = llen-1;
    rangelen = (end-start)+1;

    /* Return the result in form of a multi-bulk reply */
    addReplyMultiBulkLen(c,rangelen);
    if (o->encoding == OBJ_ENCODING_QUICKLIST) {
        listTypeIterator *iter = listTypeInitIterator(o, start, LIST_TAIL);

        while(rangelen--) {
            listTypeEntry entry;
            listTypeNext(iter, &entry);
            quicklistEntry *qe = &entry.entry;
            if (qe->value) {
                addReplyBulkCBuffer(c,qe->value,qe->sz);
            } else {
                addReplyBulkLongLong(c,qe->longval);
            }
        }
        listTypeReleaseIterator(iter);
    } else {
        serverPanic("List encoding is not QUICKLIST!");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
leaq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49f20
cmpl $0x0, %eax
jne 0x5a223
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rsi
leaq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49f20
cmpl $0x0, %eax
je 0x5a228
jmp 0x5a3d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x11ea01(%rip), %rax    # 0x178c40
movq 0x68(%rax), %rdx
callq 0x4a730
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x5a269
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x5a26e
jmp 0x5a3d0
movq -0x10(%rbp), %rdi
callq 0x59140
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x5a28e
movq -0x28(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x5a2a1
movq -0x28(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x5a2b0
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jg 0x5a2c4
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jl 0x5a2dd
movq -0x8(%rbp), %rdi
leaq 0x11e971(%rip), %rax    # 0x178c40
movq 0x68(%rax), %rsi
callq 0x42cc0
jmp 0x5a3d0
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jl 0x5a2f3
movq -0x28(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x437f0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x9, %eax
jne 0x5a3ae
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x591a0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x30(%rbp)
cmpq $0x0, %rax
je 0x5a3a3
movq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x592a0
leaq -0x70(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x5a390
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x78(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, %edx
callq 0x43920
jmp 0x5a3a1
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x439f0
jmp 0x5a33b
movq -0x38(%rbp), %rdi
callq 0x59270
jmp 0x5a3d0
leaq 0xe369d(%rip), %rdi     # 0x13da52
leaq 0xe35e8(%rip), %rsi     # 0x13d9a4
movl $0x1af, %edx            # imm = 0x1AF
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)