// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: colorConvertTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, LodePNGColorType, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, LodePNGColorType, unsigned int)
void colorConvertTest(const std::string& bits_in, LodePNGColorType colorType_in, unsigned bitDepth_in,
                      const std::string& bits_out, LodePNGColorType colorType_out, unsigned bitDepth_out) {
  std::cout << "color convert test " << bits_in << " - " << bits_out << std::endl;

  std::vector<unsigned char> expected, actual, image;
  bitStringToBytes(expected, bits_out);
  actual.resize(expected.size());
  bitStringToBytes(image, bits_in);
  LodePNGColorMode mode_in, mode_out;
  lodepng_color_mode_init(&mode_in);
  lodepng_color_mode_init(&mode_out);
  mode_in.colortype = colorType_in;
  mode_in.bitdepth = bitDepth_in;
  mode_out.colortype = colorType_out;
  mode_out.bitdepth = bitDepth_out;
  unsigned error = lodepng_convert(&actual[0], &image[0], &mode_out, &mode_in, 1, 1);

  ASSERT_NO_PNG_ERROR_MSG(error, "convert error");

  for(size_t i = 0; i < expected.size(); i++) {
    assertEquals((int)expected[i], (int)actual[i], "byte " + valtostr(i));
  }

  lodepng_color_mode_cleanup(&mode_in);
  lodepng_color_mode_cleanup(&mode_out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %r9d, %ebx
movl %r8d, %ebp
movq %rcx, %r13
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
movq 0x8b513(%rip), %rdi     # 0xa2fd8
leaq 0x48986(%rip), %rsi     # 0x60452
callq 0x21f0
movq %rax, %rdi
movq %r12, %rsi
callq 0x21d0
leaq 0x48983(%rip), %rsi     # 0x60466
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq %r13, %rsi
callq 0x17a03
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0xe6d8
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x17a03
leaq 0x150(%rsp), %rdi
callq 0x4970
leaq 0x128(%rsp), %rdi
callq 0x4970
leaq 0x150(%rsp), %rcx
movl %r15d, (%rcx)
movl %r14d, 0x4(%rcx)
leaq 0x128(%rsp), %rdx
movl %ebp, (%rdx)
movl %ebx, 0x4(%rdx)
movq 0x10(%rsp), %rdi
movq 0x50(%rsp), %rsi
pushq $0x1
popq %r8
movl %r8d, %r9d
callq 0x5390
movl %eax, %ebx
leaq 0x48639(%rip), %rsi     # 0x601dd
leaq 0x88(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20c0
leaq 0x4b88a(%rip), %rdx     # 0x63447
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x5a5df
leaq 0x48891(%rip), %rsi     # 0x6046a
leaq 0xa8(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x20c0
movq 0xb0(%rsp), %r14
testq %r14, %r14
je 0x17c2c
leaq 0x4886b(%rip), %rsi     # 0x6046a
leaq 0x108(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x20c0
leaq 0x4bb8d(%rip), %rsi     # 0x637a5
leaq 0x68(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x5a8d9
jmp 0x17c45
leaq 0x49993(%rip), %rsi     # 0x615c6
leaq 0x68(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x20c0
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x5a61f
leaq 0xe8(%rsp), %rsi
movl %ebx, %edi
callq 0x13352
leaq 0xe8(%rsp), %rdi
callq 0x2270
leaq 0x68(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x17c97
leaq 0x108(%rsp), %rdi
callq 0x2270
leaq 0xa8(%rsp), %rdi
callq 0x2270
leaq 0xc8(%rsp), %rdi
callq 0x2270
leaq 0x88(%rsp), %rdi
callq 0x2270
xorl %eax, %eax
leaq 0xc8(%rsp), %rbx
leaq 0x88(%rsp), %r14
leaq 0x487a1(%rip), %r15     # 0x60478
leaq 0xe8(%rsp), %r12
leaq 0x68(%rsp), %r13
leaq 0xa8(%rsp), %rbp
movq %rax, 0x88(%rsp)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
subq %rcx, %rdx
cmpq %rdx, %rax
jae 0x17d62
movzbl (%rcx,%rax), %ecx
movl %ecx, 0x68(%rsp)
movq 0x10(%rsp), %rcx
movzbl (%rcx,%rax), %eax
movl %eax, 0xa8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5a86b
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5a8d9
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x5a765
movq %r12, %rdi
callq 0x2270
movq %rbx, %rdi
callq 0x2270
movq 0x88(%rsp), %rax
incq %rax
jmp 0x17cec
leaq 0x150(%rsp), %rdi
callq 0x4989
leaq 0x128(%rsp), %rdi
callq 0x4989
leaq 0x50(%rsp), %rdi
callq 0xea7c
leaq 0x10(%rsp), %rdi
callq 0xea7c
leaq 0x30(%rsp), %rdi
callq 0xea7c
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17dda
movq %rax, %rbx
jmp 0x17dfd
movq %rax, %rbx
jmp 0x17e74
movq %rax, %rbx
jmp 0x17e6a
movq %rax, %rbx
jmp 0x17df8
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2270
jmp 0x17dee
movq %rax, %rbx
jmp 0x17e0a
jmp 0x17e4b
movq %rax, %rbx
jmp 0x17e24
movq %rax, %rbx
jmp 0x17e17
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x17e0a
leaq 0x108(%rsp), %rdi
callq 0x2270
leaq 0xa8(%rsp), %rdi
callq 0x2270
leaq 0xc8(%rsp), %rdi
callq 0x2270
leaq 0x88(%rsp), %rdi
callq 0x2270
jmp 0x17e60
jmp 0x17e4b
jmp 0x17e4b
jmp 0x17e4b
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x2270
jmp 0x17e53
movq %rax, %rbx
jmp 0x17e60
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x2270
leaq 0x50(%rsp), %rdi
callq 0xea7c
leaq 0x10(%rsp), %rdi
callq 0xea7c
leaq 0x30(%rsp), %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x2380
movq %rax, %rdi
callq 0xe6cc