// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: testColor(int, int, int, int)
void testColor(int r, int g, int b, int a) {
  std::cout << "codec test color " << r << " " << g << " " << b << " " << a << std::endl;
  Image image;
  image.width = 20;
  image.height = 20;
  image.colorType = LCT_RGBA;
  image.bitDepth = 8;
  image.data.resize(20 * 20 * 4);
  for(size_t y = 0; y < 20; y++)
  for(size_t x = 0; x < 20; x++) {
    image.data[20 * 4 * y + 4 * x + 0] = r;
    image.data[20 * 4 * y + 4 * x + 0] = g;
    image.data[20 * 4 * y + 4 * x + 0] = b;
    image.data[20 * 4 * y + 4 * x + 0] = a;
  }

  doCodecTest(image);

  Image image2 = image;
  image2.data[3] = 0; //one fully transparent pixel
  doCodecTest(image2);
  image2.data[3] = 128; //one semi transparent pixel
  doCodecTest(image2);

  Image image3 = image;
  // add 255 different colors
  for(size_t i = 0; i < 255; i++) {
    image.data[i * 4 + 0] = i;
    image.data[i * 4 + 1] = i;
    image.data[i * 4 + 2] = i;
    image.data[i * 4 + 3] = 255;
  }
  doCodecTest(image3);
  // a 256th color
  image.data[255 * 4 + 0] = 255;
  image.data[255 * 4 + 1] = 255;
  image.data[255 * 4 + 2] = 255;
  image.data[255 * 4 + 3] = 255;
  doCodecTest(image3);

  testSinglePixel(r, g, b, a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
movq 0x8ad57(%rip), %rdi     # 0xa2fd8
leaq 0x48236(%rip), %rsi     # 0x604be
callq 0x21f0
movq %rax, %rdi
movl %r15d, %esi
callq 0x2360
leaq 0x49326(%rip), %r12     # 0x615c5
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq %rax, %rdi
movl %r14d, %esi
callq 0x2360
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x2360
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
movq %rax, %rdi
movl %ebx, %esi
callq 0x2360
movq %rax, %rdi
callq 0x2100
movq %rsp, %rdi
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movaps 0x47d34(%rip), %xmm0    # 0x60030
movups %xmm0, 0x18(%rdi)
movl $0x640, %esi            # imm = 0x640
xorl %edx, %edx
callq 0xe6d8
xorl %eax, %eax
pushq $0x14
popq %rcx
xorl %edx, %edx
cmpq $0x14, %rdx
je 0x18354
movq %rax, %rsi
movq %rcx, %rdi
subq $0x1, %rdi
jb 0x1834b
movq (%rsp), %r8
movb %r15b, (%r8,%rsi)
movq (%rsp), %r8
movb %r14b, (%r8,%rsi)
movq (%rsp), %r8
movb %bpl, (%r8,%rsi)
movq (%rsp), %r8
movb %bl, (%r8,%rsi)
addq $0x4, %rsi
jmp 0x1831f
incq %rdx
addq $0x50, %rax
jmp 0x18313
movq %rsp, %rdi
callq 0x178ce
leaq 0x58(%rsp), %rdi
movq %rsp, %rsi
callq 0x5ab1a
leaq 0x58(%rsp), %rdi
movq (%rdi), %rax
movb $0x0, 0x3(%rax)
callq 0x178ce
leaq 0x58(%rsp), %rdi
movq (%rdi), %rax
movb $-0x80, 0x3(%rax)
callq 0x178ce
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x5ab1a
xorl %eax, %eax
cmpq $0xff, %rax
je 0x183c7
movq (%rsp), %rcx
movb %al, (%rcx,%rax,4)
movq (%rsp), %rcx
movb %al, 0x1(%rcx,%rax,4)
movq (%rsp), %rcx
movb %al, 0x2(%rcx,%rax,4)
movq (%rsp), %rcx
movb $-0x1, 0x3(%rcx,%rax,4)
incq %rax
jmp 0x1839a
leaq 0x30(%rsp), %rdi
callq 0x178ce
movq (%rsp), %rax
orl $-0x1, 0x3fc(%rax)
leaq 0x30(%rsp), %rdi
callq 0x178ce
movl %r15d, %edi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x18169
leaq 0x30(%rsp), %rdi
callq 0xea7c
leaq 0x58(%rsp), %rdi
callq 0xea7c
movq %rsp, %rdi
callq 0xea7c
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18425
jmp 0x1842a
movq %rax, %rbx
jmp 0x1843c
movq %rax, %rbx
jmp 0x18446
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xea7c
leaq 0x58(%rsp), %rdi
callq 0xea7c
movq %rsp, %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x2380
movq %rax, %rdi
callq 0xe6cc