// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/aof.c
// Function: rewriteListObject
int rewriteListObject(rio *r, robj *key, robj *o) {
    long long count = 0, items = listTypeLength(o);

    if (o->encoding == OBJ_ENCODING_QUICKLIST) {
        quicklist *list = o->ptr;
        quicklistIter *li = quicklistGetIterator(list, AL_START_HEAD);
        quicklistEntry entry;

        while (quicklistNext(li,&entry)) {
            if (count == 0) {
                int cmd_items = (items > AOF_REWRITE_ITEMS_PER_CMD) ?
                    AOF_REWRITE_ITEMS_PER_CMD : items;
                if (rioWriteBulkCount(r,'*',2+cmd_items) == 0) return 0;
                if (rioWriteBulkString(r,"RPUSH",5) == 0) return 0;
                if (rioWriteBulkObject(r,key) == 0) return 0;
            }

            if (entry.value) {
                if (rioWriteBulkString(r,(char*)entry.value,entry.sz) == 0) return 0;
            } else {
                if (rioWriteBulkLongLong(r,entry.longval) == 0) return 0;
            }
            if (++count == AOF_REWRITE_ITEMS_PER_CMD) count = 0;
            items--;
        }
        quicklistReleaseIterator(li);
    } else {
        serverPanic("Unknown list encoding");
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x59140
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x9, %eax
jne 0x72c09
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x29b10
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x29cb0
cmpl $0x0, %eax
je 0x72bfe
cmpq $0x0, -0x28(%rbp)
jne 0x72b8b
cmpq $0x40, -0x30(%rbp)
jle 0x72b0f
movl $0x40, %eax
movq %rax, -0x80(%rbp)
jmp 0x72b17
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %edx
addl $0x2, %edx
movl $0x2a, %esi
callq 0x8e820
cmpq $0x0, %rax
jne 0x72b44
movl $0x0, -0x4(%rbp)
jmp 0x72c32
movq -0x10(%rbp), %rdi
leaq 0xcd006(%rip), %rsi     # 0x13fb55
movl $0x5, %edx
callq 0x8e9c0
cmpq $0x0, %rax
jne 0x72b6b
movl $0x0, -0x4(%rbp)
jmp 0x72c32
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x729c0
cmpl $0x0, %eax
jne 0x72b89
movl $0x0, -0x4(%rbp)
jmp 0x72c32
jmp 0x72b8b
cmpq $0x0, -0x58(%rbp)
je 0x72bb5
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x48(%rbp), %eax
movl %eax, %edx
callq 0x8e9c0
cmpq $0x0, %rax
jne 0x72bb3
movl $0x0, -0x4(%rbp)
jmp 0x72c32
jmp 0x72bd3
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x8ea70
cmpq $0x0, %rax
jne 0x72bd1
movl $0x0, -0x4(%rbp)
jmp 0x72c32
jmp 0x72bd3
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x40, %rax
jne 0x72bed
movq $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x72adc
movq -0x40(%rbp), %rdi
callq 0x29c20
jmp 0x72c2b
leaq 0xca5d5(%rip), %rdi     # 0x13d1e5
leaq 0xcc760(%rip), %rsi     # 0x13f377
movl $0x33f, %edx            # imm = 0x33F
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nop