// File: /workspace/github_c_makefile_star2_O3/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 0x41718
testl %eax, %eax
jne 0x4d083
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x41718
testl %eax, %eax
je 0x4d091
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
leaq 0xb5270(%rip), %r15     # 0x102310
movq 0x68(%r15), %rdx
movq %rbx, %rdi
callq 0x41af9
testq %rax, %rax
je 0x4d083
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x40d47
testl %eax, %eax
jne 0x4d083
movq %r14, %rdi
callq 0x4c4aa
movq 0x8(%rsp), %r13
testq %r13, %r13
jns 0x4d0e2
addq %rax, %r13
movq %r13, 0x8(%rsp)
movq 0x10(%rsp), %r12
testq %r12, %r12
jns 0x4d0f4
addq %rax, %r12
movq %r12, 0x10(%rsp)
testq %r13, %r13
jns 0x4d105
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
cmpq %r12, %r13
jg 0x4d1be
cmpq %rax, %r13
jae 0x4d1be
cmpq %rax, %r12
jb 0x4d127
decq %rax
movq %rax, 0x10(%rsp)
movq %rax, %r12
movq %r12, %r15
subq %r13, %r15
incq %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3d274
movl $0xf0, %eax
andl (%r14), %eax
cmpl $0x90, %eax
jne 0x4d1cf
movq 0x8(%rsp), %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x4c4e8
movq %rax, %r14
testq %r15, %r15
je 0x4d1a8
notq %r12
addq %r13, %r12
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x4c580
movq 0x38(%rsp), %rsi
testq %rsi, %rsi
je 0x4d196
movl 0x48(%rsp), %edx
movq %rbx, %rdi
callq 0x3d346
jmp 0x4d1a3
movq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x3d415
incq %r12
jne 0x4d173
movq 0x10(%r14), %rdi
callq 0x38413
movq %r14, %rdi
callq 0x38413
jmp 0x4d083
movq 0x68(%r15), %rsi
movq %rbx, %rdi
callq 0x3c854
jmp 0x4d083
leaq 0x76214(%rip), %rdi     # 0xc33ea
leaq 0x7615f(%rip), %rsi     # 0xc333c
movl $0x1af, %edx            # imm = 0x1AF
callq 0x619b4
movl $0x1, %edi
callq 0x263c0