// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/pngdetail.cpp
// Function: displayPalette(Data&, Options const&)
void displayPalette(Data& data, const Options& options) {
  data.loadInspect();
  if(data.error) return;
  std::cout << (options.use_hex ? std::hex: std::dec);

  const LodePNGInfo& info = data.state.info_png;
  const LodePNGColorMode& color = info.color;

  std::cout << "Palette size: " << color.palettesize << std::endl;
  std::cout << "Palette colors: ";
  std::ios_base::fmtflags flags = std::cout.flags();
  std::cout << std::hex << std::setfill('0');
  for(size_t i = 0; i < color.palettesize; i++) {
    unsigned char* p = &color.palette[i * 4];
    std::cout << "#" << std::setw(2) << (int)p[0] << std::setw(2) << (int)p[1] << std::setw(2) << (int)p[2] << std::setw(2) << (int)p[3] << " ";
  }
  std::cout.flags(flags);
  std::cout << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1df4c
cmpl $0x0, 0x2d8(%r14)
je 0x17d84
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x645e(%rip), %rax      # 0x1e1e9
leaq 0x6467(%rip), %rcx      # 0x1e1f9
cmpb $0x0, 0x24(%rbx)
cmovneq %rax, %rcx
movq 0x1322f(%rip), %rbx     # 0x2afd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
callq *%rcx
leaq 0xbd33(%rip), %rsi      # 0x23ae7
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2290
movq 0x148(%r14), %rsi
movq %rbx, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
leaq 0xbcf5(%rip), %rsi      # 0x23af6
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2290
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl 0x18(%rbx,%rcx), %edx
movl %edx, 0x4(%rsp)
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %r15
cmpb $0x0, 0xe1(%rbx,%rax)
jne 0x17e4e
movq %r15, %rdi
movl $0x20, %esi
callq 0x2220
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
cmpq $0x0, 0x148(%r14)
je 0x17f15
xorl %r13d, %r13d
movl $0x2, %ebp
leaq 0xc499(%rip), %r12      # 0x2430c
movq 0x140(%r14), %r15
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xbc0a(%rip), %rsi      # 0x23a93
callq 0x2290
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbp, 0x10(%rbx,%rax)
movzbl (%r15,%r13,4), %esi
movq %rbx, %rdi
callq 0x2390
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %rbp, 0x10(%rax,%rcx)
movzbl 0x1(%r15,%r13,4), %esi
movq %rax, %rdi
callq 0x2390
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %rbp, 0x10(%rax,%rcx)
movzbl 0x2(%r15,%r13,4), %esi
movq %rax, %rdi
callq 0x2390
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %rbp, 0x10(%rax,%rcx)
movzbl 0x3(%r15,%r13,4), %esi
movq %rax, %rdi
callq 0x2390
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2290
incq %r13
cmpq 0x148(%r14), %r13
jb 0x17e73
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl 0x4(%rsp), %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2170