// File: /workspace/github_cpp_makefile_star2_O3/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, %r12d
movl %edx, %ebx
movl %esi, %ebp
movl %edi, 0xc(%rsp)
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 0x169a0
leaq 0x110(%rsp), %rdi
callq 0x5861
movl 0x1d8(%rsp), %eax
movl 0x1d0(%rsp), %ecx
movl %eax, 0x114(%rsp)
movl %ecx, 0x110(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x5861
movl %ebp, 0x4(%rsp)
movl %ebx, 0x8(%rsp)
movabsq $0x1000000006, %rax     # imm = 0x1000000006
movq %rax, 0x160(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x5861
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 0x5a2a
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 0x7076e
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 0x642f
movl %eax, %ebp
movl %r12d, (%rsp)
leaq 0xe0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x25ea3(%rip), %rsi     # 0x7637d
leaq 0x25ea1(%rip), %rdx     # 0x76382
leaq 0xd0(%rsp), %rdi
callq 0x14f6e
leaq 0x20(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x1518a
leaq 0x2900d(%rip), %rsi     # 0x79528
leaq 0x10(%rsp), %rdi
callq 0x23e0
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x27231(%rip), %rdx     # 0x77766
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
movq 0x60(%rsp), %rbx
testq %rbx, %rbx
je 0x5058d
leaq 0xa0(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x27207(%rip), %rdx     # 0x77766
leaq 0x90(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
leaq 0x293cf(%rip), %rsi     # 0x79945
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x70423
jmp 0x505b0
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x271c6(%rip), %rdx     # 0x77766
leaq 0xb0(%rsp), %rdi
movq %rdx, %rsi
callq 0x14f6e
leaq 0xf0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
callq 0x70057
leaq 0xf0(%rsp), %rsi
movl %ebp, %edi
callq 0x16314
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x505ef
callq 0x2210
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50605
callq 0x2210
testq %rbx, %rbx
leaq 0x20(%rsp), %rbx
je 0x50625
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50625
callq 0x2210
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x50639
callq 0x2210
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x50648
callq 0x2210
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x5065a
callq 0x2210
leaq 0x30(%rsp), %rbp
leaq 0x78(%rsp), %rsi
movq %rbp, %rdi
callq 0x14de6
movl (%rsp), %ecx
movb 0x1f0(%rsp), %al
movl 0x48(%rsp), %r10d
movl 0x4c(%rsp), %r11d
subq $0x8, %rsp
movzbl 0x200(%rsp), %ebx
movzbl %al, %eax
movl 0x14(%rsp), %edi
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
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 0x4e167
addq $0x40, %rsp
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x506d2
callq 0x2210
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x506e1
callq 0x2210
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x50707
movq %rax, %r14
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x5075b
jmp 0x50756
movq %rax, %r14
jmp 0x5075b
movq %rax, %r14
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5072a
callq 0x2210
jmp 0x5072a
movq %rax, %r14
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50740
callq 0x2210
testq %rbx, %rbx
je 0x5075b
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5075b
callq 0x2210
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x50774
callq 0x2210
jmp 0x50774
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5079c
callq 0x2210
jmp 0x5079c
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5079c
jmp 0x50783
movq %rax, %r14
movq 0xd0(%rsp), %rdi
cmpq %r12, %rdi
je 0x507c4
callq 0x2210
jmp 0x507c4
jmp 0x507c1
jmp 0x507bc
jmp 0x507bc
jmp 0x507bc
jmp 0x507bc
jmp 0x507bc
movq %rax, %r14
jmp 0x507d3
movq %rax, %r14
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x507d3
callq 0x2210
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x507e2
callq 0x2210
movq %r14, %rdi
callq 0x23c0