// File: /workspace/github_cpp_makefile_star2_O1/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 0x980cc(%rip), %rbx     # 0xb3fd8
leaq 0x5a4bf(%rip), %rsi     # 0x763d2
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2270
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x2270
movq %rax, %rbx
leaq 0x5a4ab(%rip), %rsi     # 0x763e6
movl $0x3, %edx
movq %rax, %rdi
callq 0x2270
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0x2270
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2160
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 0x1be38
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
leaq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x10b40
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x1be38
leaq 0x150(%rsp), %rdi
callq 0x528f
leaq 0x128(%rsp), %rdi
callq 0x528f
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 0x5e9a
movl %eax, %ebx
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5a115(%rip), %rsi     # 0x7615d
leaq 0x5a113(%rip), %rdx     # 0x76162
leaq 0x50(%rsp), %rdi
callq 0x1517a
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x15390
leaq 0x5d347(%rip), %rsi     # 0x793c7
leaq 0x10(%rsp), %rdi
callq 0x23d0
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5a34d(%rip), %rsi     # 0x763ea
leaq 0x5a353(%rip), %rdx     # 0x763f7
leaq 0xe8(%rsp), %rdi
callq 0x1517a
movq 0xf0(%rsp), %r12
testq %r12, %r12
setne %bpl
je 0x1c107
leaq 0x118(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5a315(%rip), %rsi     # 0x763ea
leaq 0x5a31b(%rip), %rdx     # 0x763f7
leaq 0x108(%rsp), %rdi
callq 0x1517a
leaq 0x5d635(%rip), %rsi     # 0x79725
leaq 0xc8(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x702b8
jmp 0x1c12a
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b42c(%rip), %rdx     # 0x77546
leaq 0xc8(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x6feec
leaq 0x90(%rsp), %rsi
movl %ebx, %edi
callq 0x16534
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c169
callq 0x2200
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c17f
callq 0x2200
testq %r12, %r12
je 0x1c19a
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c19a
callq 0x2200
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1c1ac
callq 0x2200
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c1c0
callq 0x2200
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c1cf
callq 0x2200
movq $0x0, 0x50(%rsp)
movq 0x30(%rsp), %rcx
cmpq %rcx, 0x38(%rsp)
je 0x1c2a6
xorl %eax, %eax
leaq 0x10(%rsp), %rbx
leaq 0x50(%rsp), %r14
leaq 0x5a1fd(%rip), %r15     # 0x763f8
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 0x7024a
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x702b8
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x700c5
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c26f
callq 0x2200
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c283
callq 0x2200
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 0x1c213
leaq 0x150(%rsp), %rdi
callq 0x52a8
leaq 0x128(%rsp), %rdi
callq 0x52a8
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c2d2
callq 0x2200
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c2e1
callq 0x2200
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c2f0
callq 0x2200
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1c369
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x1c34b
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x1c366
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c335
callq 0x2200
jmp 0x1c335
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c34b
callq 0x2200
testb %bpl, %bpl
je 0x1c366
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c366
callq 0x2200
testb %bpl, %bpl
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1c382
callq 0x2200
jmp 0x1c382
jmp 0x1c37f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c39b
callq 0x2200
jmp 0x1c39b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1c3e5
jmp 0x1c3ea
jmp 0x1c3af
jmp 0x1c3af
jmp 0x1c3af
jmp 0x1c3af
movq %rax, %rbx
jmp 0x1c3ea
movq %rax, %rbx
jmp 0x1c3d6
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1c3d6
callq 0x2200
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c3ea
callq 0x2200
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c3fc
callq 0x2200
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c40b
callq 0x2200
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c41a
callq 0x2200
movq %rbx, %rdi
callq 0x23b0