// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: testRGBToPaletteConvert()
void testRGBToPaletteConvert() {
  unsigned char palette1[4] = {1,2,3,4};
  doRGBAToPaletteTest(palette1, 1);
  unsigned char palette2[8] = {1,2,3,4, 5,6,7,8};
  doRGBAToPaletteTest(palette2, 2);
  unsigned char palette3[12] = {1,1,1,255, 20,20,20,255, 20,20,21,255};
  doRGBAToPaletteTest(palette3, 3);

  std::vector<unsigned char> palette;
  for(int i = 0; i < 256; i++) {
    palette.push_back(i);
    palette.push_back(5);
    palette.push_back(6);
    palette.push_back(128);
  }
  doRGBAToPaletteTest(&palette[0], 256);
  palette.push_back(5);
  palette.push_back(6);
  palette.push_back(7);
  palette.push_back(8);
  doRGBAToPaletteTest(&palette[0], 257, LCT_RGBA);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
leaq 0x34(%rsp), %rdi
movl $0x4030201, (%rdi)      # imm = 0x4030201
movl $0x1, %esi
movl $0x3, %edx
callq 0x2a6ea
movabsq $0x807060504030201, %rax # imm = 0x807060504030201
leaq 0x38(%rsp), %rdi
movq %rax, (%rdi)
movl $0x2, %esi
movl $0x3, %edx
callq 0x2a6ea
leaq 0x736bb(%rip), %rdi     # 0x9f154
movl $0x3, %esi
movl $0x3, %edx
callq 0x2a6ea
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
xorl %ebp, %ebp
leaq 0xf(%rsp), %r14
movb %bpl, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2badd
movb %bpl, (%rsi)
incq 0x18(%rsp)
jmp 0x2bae8
movq %rbx, %rdi
movq %r14, %rdx
callq 0x16342
movb $0x5, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bb03
movb $0x5, (%rsi)
incq 0x18(%rsp)
jmp 0x2bb0e
movq %rbx, %rdi
movq %r14, %rdx
callq 0x16342
movb $0x6, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bb29
movb $0x6, (%rsi)
incq 0x18(%rsp)
jmp 0x2bb34
movq %rbx, %rdi
movq %r14, %rdx
callq 0x16342
movb $-0x80, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bb4f
movb $-0x80, (%rsi)
incq 0x18(%rsp)
jmp 0x2bb5a
movq %rbx, %rdi
movq %r14, %rdx
callq 0x16342
incl %ebp
cmpl $0x100, %ebp            # imm = 0x100
jne 0x2bac2
movq 0x10(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movl $0x3, %edx
callq 0x2a6ea
movb $0x5, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bb97
movb $0x5, (%rsi)
incq 0x18(%rsp)
jmp 0x2bba6
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x16342
movb $0x6, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bbc1
movb $0x6, (%rsi)
incq 0x18(%rsp)
jmp 0x2bbd0
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x16342
movb $0x7, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bbeb
movb $0x7, (%rsi)
incq 0x18(%rsp)
jmp 0x2bbfa
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x16342
movb $0x8, 0xf(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x2bc15
movb $0x8, (%rsi)
incq 0x18(%rsp)
jmp 0x2bc24
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x16342
movq 0x10(%rsp), %rdi
movl $0x101, %esi            # imm = 0x101
movl $0x6, %edx
callq 0x2a6ea
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2bc47
callq 0x2200
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x2bc60
jmp 0x2bc60
jmp 0x2bc60
jmp 0x2bc60
jmp 0x2bc60
jmp 0x2bc60
jmp 0x2bc60
jmp 0x2bc60
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2bc72
callq 0x2200
movq %rbx, %rdi
callq 0x23b0