// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: testBkgdChunk(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, LodePNGColorType, unsigned int, LodePNGColorType, unsigned int, LodePNGColorType, unsigned int, bool, bool)
void testBkgdChunk(unsigned r, unsigned g, unsigned b,
                   unsigned r2, unsigned g2, unsigned b2,
                   LodePNGColorType type_pixels, unsigned bitdepth_pixels,
                   LodePNGColorType type_raw, unsigned bitdepth_raw,
                   LodePNGColorType type_png, unsigned bitdepth_png,
                   bool auto_convert, bool expect_encoder_error = false) {
  unsigned error;
  Image image;
  generateTestImageRequiringColorType16(image, type_pixels, bitdepth_pixels, false);

  LodePNGColorMode mode_raw; lodepng_color_mode_init(&mode_raw); mode_raw.bitdepth = bitdepth_raw; mode_raw.colortype = type_raw;
  LodePNGColorMode mode_test; lodepng_color_mode_init(&mode_test); mode_test.bitdepth = 16; mode_test.colortype = LCT_RGBA;
  LodePNGColorMode mode_png; lodepng_color_mode_init(&mode_png); mode_png.bitdepth = bitdepth_png; mode_png.colortype = type_png;
  std::vector<unsigned char> temp((image.width * image.height * lodepng_get_bpp(&mode_raw) + 7) / 8);
  error = lodepng_convert(temp.data(), image.data.data(), &mode_raw, &mode_test, image.width, image.height);
  ASSERT_NO_PNG_ERROR(error);
  image.data = temp;

  testBkgdChunk(r, g, b, r2, g2, b2,
                image.data, image.width, image.height,
                mode_raw, mode_png, auto_convert, expect_encoder_error);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %r9d, %r14d
movl %r8d, %r15d
movl %ecx, %r13d
movl %edx, %r12d
movl %esi, %ebx
movl %edi, %ebp
movl 0x1c0(%rsp), %esi
movl 0x1c8(%rsp), %edx
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %ecx, %ecx
callq 0x16bd5
leaq 0x110(%rsp), %rdi
callq 0x528f
movl 0x1d8(%rsp), %eax
movl 0x1d0(%rsp), %ecx
movl %eax, 0x114(%rsp)
movl %ecx, 0x110(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x528f
movl %ebp, 0x8(%rsp)
movl %ebx, 0xc(%rsp)
movabsq $0x1000000006, %rax     # imm = 0x1000000006
movq %rax, 0x160(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x528f
movl 0x1e8(%rsp), %eax
movl 0x1e0(%rsp), %ecx
movl %eax, 0x13c(%rsp)
movl %ecx, 0x138(%rsp)
movl 0x48(%rsp), %ebp
movl 0x4c(%rsp), %ebx
leaq 0x110(%rsp), %rdi
callq 0x5452
imull %ebp, %ebx
imull %eax, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
leaq 0xf0(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rcx
movq %rbx, %rsi
callq 0x70602
movq 0x78(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl 0x48(%rsp), %r8d
movl 0x4c(%rsp), %r9d
leaq 0x110(%rsp), %rdx
leaq 0x160(%rsp), %rcx
callq 0x5e9a
movl %eax, %ebp
movl %r12d, 0x4(%rsp)
leaq 0xc0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x25bdb(%rip), %rsi     # 0x7615d
leaq 0x25bd9(%rip), %rdx     # 0x76162
leaq 0xb0(%rsp), %rdi
callq 0x1517a
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x15390
movl %r13d, %ebx
leaq 0x28d42(%rip), %rsi     # 0x79308
leaq 0x10(%rsp), %rdi
callq 0x23d0
movl %r15d, %r13d
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x26f63(%rip), %rdx     # 0x77546
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
movq 0x60(%rsp), %r15
testq %r15, %r15
setne 0x3(%rsp)
je 0x50640
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x26f34(%rip), %rdx     # 0x77546
leaq 0xd0(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
leaq 0x290fc(%rip), %rsi     # 0x79725
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0x702b8
jmp 0x50663
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x26ef3(%rip), %rdx     # 0x77546
leaq 0x90(%rsp), %rdi
movq %rdx, %rsi
callq 0x1517a
leaq 0xf0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x6feec
leaq 0xf0(%rsp), %rsi
movl %ebp, %edi
callq 0x16534
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x506a2
callq 0x2200
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x506b8
callq 0x2200
testq %r15, %r15
movl %r13d, %r15d
movl %ebx, %r13d
je 0x506d9
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x506d9
callq 0x2200
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x506ed
callq 0x2200
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x50701
callq 0x2200
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x50713
callq 0x2200
leaq 0x30(%rsp), %rbp
leaq 0x78(%rsp), %rsi
movq %rbp, %rdi
callq 0x15008
movl 0x4(%rsp), %edx
movb 0x1f0(%rsp), %al
movl 0x48(%rsp), %r10d
movl 0x4c(%rsp), %r11d
subq $0x8, %rsp
movzbl 0x200(%rsp), %ebx
movzbl %al, %eax
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movl %r13d, %ecx
movl %r15d, %r8d
movl %r14d, %r9d
pushq %rbx
pushq %rax
leaq 0x150(%rsp), %rax
pushq %rax
leaq 0x130(%rsp), %rax
pushq %rax
pushq %r11
pushq %r10
pushq %rbp
callq 0x4e208
addq $0x40, %rsp
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x5078b
callq 0x2200
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5079a
callq 0x2200
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x5081b
movq %rax, %r15
movb $0x1, 0x3(%rsp)
jmp 0x507f9
movq %rax, %r15
movb $0x1, 0x3(%rsp)
jmp 0x50816
movq %rax, %r15
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x507e3
callq 0x2200
jmp 0x507e3
movq %rax, %r15
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x507f9
callq 0x2200
cmpb $0x0, 0x3(%rsp)
je 0x50816
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50816
callq 0x2200
cmpb $0x0, 0x3(%rsp)
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x50834
callq 0x2200
jmp 0x50834
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x50861
callq 0x2200
jmp 0x50861
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x50861
jmp 0x50843
movq %rax, %r15
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x50889
callq 0x2200
jmp 0x50889
jmp 0x50886
jmp 0x50881
jmp 0x50881
jmp 0x50881
jmp 0x50881
jmp 0x50881
movq %rax, %r15
jmp 0x50898
movq %rax, %r15
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x50898
callq 0x2200
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x508a7
callq 0x2200
movq %r15, %rdi
callq 0x23b0