// File: /workspace/github_cpp_makefile_star2_O3/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, 0xc(%rsp)
movl %r8d, %ebp
movq %rcx, %r13
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
movq 0x9835d(%rip), %rbx     # 0xb3fd8
leaq 0x5a970(%rip), %rsi     # 0x765f2
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2280
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
leaq 0x5a95c(%rip), %rsi     # 0x76606
movl $0x3, %edx
movq %rax, %rdi
callq 0x2280
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0x2280
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2170
xorl %eax, %eax
leaq 0x30(%rsp), %rdi
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq %rax, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq %rax, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq %r13, %rsi
callq 0x1bba7
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x1078a
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x1bba7
leaq 0x150(%rsp), %rdi
callq 0x5861
leaq 0x128(%rsp), %rdi
callq 0x5861
leaq 0x150(%rsp), %rcx
movl %r15d, (%rcx)
movl %r14d, 0x4(%rcx)
leaq 0x128(%rsp), %rdx
movl %ebp, (%rdx)
movl 0xc(%rsp), %eax
movl %eax, 0x4(%rdx)
movq 0x70(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x642f
movl %eax, %ebx
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5a5c6(%rip), %rsi     # 0x7637d
leaq 0x5a5c4(%rip), %rdx     # 0x76382
leaq 0x50(%rsp), %rdi
callq 0x14f6e
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x1518a
leaq 0x5d7f8(%rip), %rsi     # 0x795e7
leaq 0x10(%rsp), %rdi
callq 0x23e0
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5a7fe(%rip), %rsi     # 0x7660a
leaq 0x5a804(%rip), %rdx     # 0x76617
leaq 0xe8(%rsp), %rdi
callq 0x14f6e
movq 0xf0(%rsp), %r12
testq %r12, %r12
je 0x1be72
leaq 0x118(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x5a7ca(%rip), %rsi     # 0x7660a
leaq 0x5a7d0(%rip), %rdx     # 0x76617
leaq 0x108(%rsp), %rdi
callq 0x14f6e
leaq 0x5daea(%rip), %rsi     # 0x79945
leaq 0xc8(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x70423
jmp 0x1be95
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b8e1(%rip), %rdx     # 0x77766
leaq 0xc8(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x70057
leaq 0x90(%rsp), %rsi
movl %ebx, %edi
callq 0x16314
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1bed4
callq 0x2210
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1beea
callq 0x2210
testq %r12, %r12
je 0x1bf05
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1bf05
callq 0x2210
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bf17
callq 0x2210
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1bf2b
callq 0x2210
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bf3a
callq 0x2210
movq $0x0, 0x50(%rsp)
movq 0x30(%rsp), %rcx
cmpq %rcx, 0x38(%rsp)
je 0x1c011
xorl %eax, %eax
leaq 0x10(%rsp), %rbx
leaq 0x50(%rsp), %r14
leaq 0x5a6b2(%rip), %r15     # 0x76618
leaq 0x90(%rsp), %r12
leaq 0xc8(%rsp), %r13
leaq 0xe8(%rsp), %rbp
movzbl (%rcx,%rax), %ecx
movl %ecx, 0xc8(%rsp)
movq 0x70(%rsp), %rcx
movzbl (%rcx,%rax), %eax
movl %eax, 0xe8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x703b5
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x70423
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x70230
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1bfda
callq 0x2210
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1bfee
callq 0x2210
movq 0x50(%rsp), %rax
incq %rax
movq %rax, 0x50(%rsp)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
subq %rcx, %rdx
cmpq %rdx, %rax
jb 0x1bf7e
leaq 0x150(%rsp), %rdi
callq 0x587a
leaq 0x128(%rsp), %rdi
callq 0x587a
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c03d
callq 0x2210
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c04c
callq 0x2210
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c05b
callq 0x2210
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c081
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r13, %rdi
jne 0x1c0d0
jmp 0x1c0d5
movq %rax, %rbx
jmp 0x1c0d5
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c0a4
callq 0x2210
jmp 0x1c0a4
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c0ba
callq 0x2210
testq %r12, %r12
je 0x1c0d5
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c0d5
callq 0x2210
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1c0ee
callq 0x2210
jmp 0x1c0ee
jmp 0x1c0eb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c107
callq 0x2210
jmp 0x1c107
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1c151
jmp 0x1c156
jmp 0x1c11b
jmp 0x1c11b
jmp 0x1c11b
jmp 0x1c11b
movq %rax, %rbx
jmp 0x1c156
movq %rax, %rbx
jmp 0x1c142
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c142
callq 0x2210
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c156
callq 0x2210
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c168
callq 0x2210
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c177
callq 0x2210
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c186
callq 0x2210
movq %rbx, %rdi
callq 0x23c0