// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: testPaletteToPaletteConvert()
void testPaletteToPaletteConvert() {
  std::cout << "testPaletteToPaletteConvert" << std::endl;
  unsigned error;
  unsigned w = 16, h = 16;
  std::vector<unsigned char> image(w * h);
  for(size_t i = 0; i < w * h; i++) image[i] = i % 256;
  lodepng::State state;
  LodePNGInfo& info = state.info_png;
  info.color.colortype = state.info_raw.colortype = LCT_PALETTE;
  info.color.bitdepth = state.info_raw.bitdepth = 8;
  ASSERT_EQUALS(true, state.encoder.auto_convert);
  for(size_t i = 0; i < 256; i++) {
    lodepng_palette_add(&info.color, i, i, i, i);
  }
  std::vector<unsigned char> png;
  for(size_t i = 0; i < 256; i++) {
    lodepng_palette_add(&state.info_raw, i, i, i, i);
  }
  error = lodepng::encode(png, &image[0], w, h, state);
  ASSERT_NO_PNG_ERROR(error);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x380, %rsp            # imm = 0x380
movq 0x7f634(%rip), %rdi     # 0xa2fd8
leaq 0x3d9ca(%rip), %rsi     # 0x61375
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x100(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movl $0x100, %esi            # imm = 0x100
callq 0x5ab3a
xorl %eax, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x239f4
movq 0xc8(%rsp), %rcx
movb %al, (%rcx,%rax)
incq %rax
jmp 0x239dc
leaq 0x100(%rsp), %rdi
callq 0xb84c
movabsq $0x800000003, %rax      # imm = 0x800000003
movq %rax, 0x1a8(%rsp)
movq %rax, 0x1e0(%rsp)
cmpl $0x1, 0x180(%rsp)
jne 0x23bf3
leaq 0x1a8(%rsp), %rbx
leaq 0x1e0(%rsp), %r14
xorl %r15d, %r15d
cmpq $0x100, %r15            # imm = 0x100
je 0x23a5d
movzbl %r15b, %ecx
movq %r14, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x4a2f
incq %r15
jmp 0x23a3c
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
andq $0x0, 0xc0(%rsp)
xorl %r14d, %r14d
cmpq $0x100, %r14            # imm = 0x100
je 0x23a95
movzbl %r14b, %ecx
movq %rbx, %rdi
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x4a2f
incq %r14
jmp 0x23a74
movq 0xc8(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
pushq $0x10
popq %rcx
leaq 0x100(%rsp), %r8
movl %ecx, %edx
callq 0xbb76
movl %eax, %ebx
leaq 0x3c71d(%rip), %rsi     # 0x601dd
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20c0
leaq 0x3d8db(%rip), %rdx     # 0x613b1
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x5a5df
leaq 0x3dada(%rip), %rsi     # 0x615c6
leaq 0x90(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x20c0
movq 0x98(%rsp), %r14
testq %r14, %r14
je 0x23b3f
leaq 0x3dab4(%rip), %rsi     # 0x615c6
leaq 0xe0(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x20c0
leaq 0x3fc7a(%rip), %rsi     # 0x637a5
leaq 0x50(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x5a8d9
jmp 0x23b58
leaq 0x3da80(%rip), %rsi     # 0x615c6
leaq 0x50(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x20c0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x5a61f
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
callq 0x13352
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x50(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x23b9e
leaq 0xe0(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0x30(%rsp), %rdi
callq 0x2270
leaq 0x70(%rsp), %rdi
callq 0x2270
leaq 0xb0(%rsp), %rdi
callq 0xea7c
leaq 0x100(%rsp), %rdi
callq 0xb874
leaq 0xc8(%rsp), %rdi
callq 0xea7c
addq $0x380, %rsp            # imm = 0x380
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3c5e3(%rip), %rsi     # 0x601dd
leaq 0x90(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x20c0
leaq 0x3d77b(%rip), %rdx     # 0x61391
leaq 0x50(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5a5df
leaq 0x3fb76(%rip), %rdx     # 0x637a5
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x5a5df
leaq 0x3d751(%rip), %rdx     # 0x61396
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x5a5df
leaq 0x3c5ca(%rip), %rdx     # 0x60225
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x5a5df
movq 0x7f367(%rip), %rdi     # 0xa2fd8
leaq 0x10(%rsp), %rsi
callq 0x21d0
leaq 0x10(%rsp), %rdi
callq 0x2270
leaq 0x30(%rsp), %rdi
callq 0x2270
leaq 0x70(%rsp), %rdi
callq 0x2270
leaq 0x50(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
movq 0x7f321(%rip), %rdi     # 0xa2fd8
leaq 0x6524f(%rip), %rsi     # 0x88f0d
callq 0x21f0
movq %rax, %rbx
leaq 0x70(%rsp), %rsi
movb $0x1, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x5ae55
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x3c551(%rip), %rsi     # 0x6023d
movq %rax, %rdi
callq 0x21f0
movq %rax, %rbx
leaq 0x180(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x5a957
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x21d0
leaq 0x3c407(%rip), %rsi     # 0x60124
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2100
leaq 0x30(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %rdi
callq 0x2270
callq 0x13280
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2270
jmp 0x23d5a
jmp 0x23d57
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x23e58
jmp 0x23e55
jmp 0x23e55
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x23d85
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2270
jmp 0x23d94
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2270
jmp 0x23da3
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2270
jmp 0x23db2
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x2270
jmp 0x23e58
jmp 0x23deb
jmp 0x23e55
movq %rax, %rbx
jmp 0x23e0e
jmp 0x23e55
movq %rax, %rbx
jmp 0x23e09
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2270
jmp 0x23dff
jmp 0x23e43
movq %rax, %rbx
jmp 0x23e1b
jmp 0x23e43
movq %rax, %rbx
jmp 0x23e32
movq %rax, %rbx
jmp 0x23e28
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x23e1b
leaq 0xe0(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0x30(%rsp), %rdi
callq 0x2270
leaq 0x70(%rsp), %rdi
callq 0x2270
jmp 0x23e46
movq %rax, %rbx
jmp 0x23e65
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xea7c
jmp 0x23e58
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0xb874
leaq 0xc8(%rsp), %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x2380
movq %rax, %rdi
callq 0xe6cc