// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %edx
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0xf8e79(%rip), %rdi     # 0x13a908
movb $0x0, %al
callq 0x260a0
movq -0x8(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0x41bed
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x40400
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
subq %rax, %rcx
movl -0x28(%rbp), %r8d
addl -0x2c(%rbp), %r8d
movl -0x28(%rbp), %r9d
movl -0x34(%rbp), %r11d
movl -0x38(%rbp), %r10d
movl -0x2c(%rbp), %eax
leaq 0xf8e46(%rip), %rdi     # 0x13a937
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x260a0
movl -0x28(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movzbl -0x24(%rbp), %eax
andl $0xc0, %eax
cmpl $0xc0, %eax
jge 0x41ba3
cmpl $0x28, -0x2c(%rbp)
jbe 0x41b6a
movq -0x10(%rbp), %rdi
movq 0x1314c2(%rip), %rax    # 0x172ff8
movq (%rax), %rcx
movl $0x28, %esi
movl $0x1, %edx
callq 0x26b10
cmpq $0x0, %rax
jne 0x41b5a
leaq 0xf8e3b(%rip), %rdi     # 0x13a990
callq 0x26b70
leaq 0x10950b(%rip), %rdi    # 0x14b06c
movb $0x0, %al
callq 0x260a0
jmp 0x41ba1
cmpl $0x0, -0x2c(%rbp)
je 0x41b9f
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
movq 0x131478(%rip), %rax    # 0x172ff8
movq (%rax), %rcx
movl $0x1, %edx
callq 0x26b10
cmpq $0x0, %rax
jne 0x41b9f
leaq 0xf8df6(%rip), %rdi     # 0x13a990
callq 0x26b70
jmp 0x41ba1
jmp 0x41bc1
movq -0x10(%rbp), %rdi
movzbl -0x24(%rbp), %esi
callq 0x402c0
movq %rax, %rsi
leaq 0x1012cf(%rip), %rdi    # 0x142e89
movb $0x0, %al
callq 0x260a0
leaq 0xf8271(%rip), %rdi     # 0x139e39
movb $0x0, %al
callq 0x260a0
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x41aa2
leaq 0xf8da3(%rip), %rdi     # 0x13a997
movb $0x0, %al
callq 0x260a0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)