// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/ziplist.c
// Function: ziplistRepr
void ziplistRepr(unsigned char *zl) {
    unsigned char *p;
    int index = 0;
    zlentry entry;

    printf(
        "{total bytes %d} "
        "{length %u}\n"
        "{tail offset %u}\n",
        intrev32ifbe(ZIPLIST_BYTES(zl)),
        intrev16ifbe(ZIPLIST_LENGTH(zl)),
        intrev32ifbe(ZIPLIST_TAIL_OFFSET(zl)));
    p = ZIPLIST_ENTRY_HEAD(zl);
    while(*p != ZIP_END) {
        zipEntry(p, &entry);
        printf(
            "{"
                "addr 0x%08lx, "
                "index %2d, "
                "offset %5ld, "
                "rl: %5u, "
                "hs %2u, "
                "pl: %5u, "
                "pls: %2u, "
                "payload %5u"
            "} ",
            (long unsigned)p,
            index,
            (unsigned long) (p-zl),
            entry.headersize+entry.len,
            entry.headersize,
            entry.prevrawlen,
            entry.prevrawlensize,
            entry.len);
        p += entry.headersize;
        if (ZIP_IS_STR(entry.encoding)) {
            if (entry.len > 40) {
                if (fwrite(p,40,1,stdout) == 0) perror("fwrite");
                printf("...");
            } else {
                if (entry.len &&
                    fwrite(p,entry.len,1,stdout) == 0) perror("fwrite");
            }
        } else {
            printf("%lld", (long long) zipLoadInteger(p,entry.encoding));
        }
        printf("\n");
        p += entry.len;
        index++;
    }
    printf("{end}\n\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movzwl 0x8(%rdi), %edx
movl (%rdi), %esi
movl 0x4(%rdi), %ecx
leaq 0x83ff7(%rip), %rdi     # 0xbfbe0
xorl %eax, %eax
callq 0x260a0
cmpb $-0x1, 0xa(%rbx)
je 0x3bd0f
leaq 0xa(%rbx), %r12
xorl %r13d, %r13d
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3ad62
movq %r12, %rcx
subq %rbx, %rcx
movl 0x18(%rsp), %r15d
movl 0x14(%rsp), %ebp
leal (%r15,%rbp), %r8d
movl 0x8(%rsp), %r10d
movl 0xc(%rsp), %r11d
subq $0x8, %rsp
leaq 0x83fd9(%rip), %rdi     # 0xbfc0f
movq %r12, %rsi
movl %r13d, %edx
movl %r15d, %r9d
xorl %eax, %eax
pushq %rbp
pushq %r10
pushq %r11
callq 0x260a0
addq $0x20, %rsp
movq %r12, %r14
addq %r15, %r14
movb 0x1c(%rsp), %al
cmpb $-0x41, %al
jbe 0x3bc7b
movzbl %al, %esi
movq %r14, %rdi
callq 0x3acda
leaq 0x8d199(%rip), %rdi     # 0xc8e08
movq %rax, %rsi
xorl %eax, %eax
callq 0x260a0
jmp 0x3bcd5
cmpl $0x29, %ebp
jb 0x3bcb1
movq 0xc1361(%rip), %rax     # 0xfcfe8
movq (%rax), %rcx
movl $0x28, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0x26b10
testq %rax, %rax
je 0x3bcf3
leaq 0x955e4(%rip), %rdi     # 0xd128c
xorl %eax, %eax
callq 0x260a0
jmp 0x3bcd5
testq %rbp, %rbp
je 0x3bcd5
movq 0xc132b(%rip), %rax     # 0xfcfe8
movq (%rax), %rcx
movl $0x1, %edx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x26b10
testq %rax, %rax
je 0x3bd01
movl $0xa, %edi
callq 0x26320
leaq (%r14,%rbp), %r12
incl %r13d
cmpb $-0x1, (%r14,%rbp)
jne 0x3bc01
jmp 0x3bd0f
leaq 0x83f6e(%rip), %rdi     # 0xbfc68
callq 0x26b60
jmp 0x3bca1
leaq 0x83f60(%rip), %rdi     # 0xbfc68
callq 0x26b60
jmp 0x3bcd5
leaq 0x83f59(%rip), %rdi     # 0xbfc6f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x26250
nopl (%rax)