// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x3ab5e
testl %eax, %eax
jne 0x44d79
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x3ab5e
testl %eax, %eax
je 0x44d87
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0xb557a(%rip), %r13     # 0xfa310
movq 0x68(%r13), %rdx
movq %rbx, %rdi
callq 0x3aee5
testq %rax, %rax
je 0x44d79
movq %rax, %r14
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3a311
testl %eax, %eax
jne 0x44d79
movq %r14, %rdi
callq 0x4427e
movq 0x8(%rsp), %r15
testq %r15, %r15
jns 0x44dd6
addq %rax, %r15
movq %r15, 0x8(%rsp)
movq 0x10(%rsp), %r12
testq %r12, %r12
jns 0x44de8
addq %rax, %r12
movq %r12, 0x10(%rsp)
testq %r15, %r15
jns 0x44df6
andq $0x0, 0x8(%rsp)
xorl %r15d, %r15d
cmpq %r12, %r15
jg 0x44e90
cmpq %rax, %r15
jae 0x44e90
cmpq %rax, %r12
jb 0x44e18
decq %rax
movq %rax, 0x10(%rsp)
movq %rax, %r12
movq %r12, %rsi
subq %r15, %rsi
incq %rsi
movq %rbx, %rdi
callq 0x370d9
movl $0xf0, %eax
andl (%r14), %eax
cmpl $0x90, %eax
jne 0x44eae
movq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x442b8
movq %rax, %r14
notq %r12
addq %r15, %r12
leaq 0x18(%rsp), %r15
testq %r12, %r12
je 0x44ea1
movq %r14, %rdi
movq %r15, %rsi
callq 0x44347
movq 0x38(%rsp), %rsi
testq %rsi, %rsi
je 0x44e7e
movl 0x48(%rsp), %edx
movq %rbx, %rdi
callq 0x3716c
jmp 0x44e8b
movq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x37206
incq %r12
jmp 0x44e56
movq 0x68(%r13), %rsi
movq %rbx, %rdi
callq 0x36987
jmp 0x44d79
movq %r14, %rdi
callq 0x44331
jmp 0x44d79
leaq 0x6fac9(%rip), %rdi     # 0xb497e
leaq 0x6fa14(%rip), %rsi     # 0xb48d0
movl $0x1af, %edx            # imm = 0x1AF
callq 0x57b45
pushq $0x1
popq %rdi
callq 0x263c0