// File: /workspace/github_cpp_makefile_star2_O2/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, %r15d
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, %r14d
movl %esi, %ebx
movl %edi, %ebp
movl 0x1c0(%rsp), %esi
movl 0x1c8(%rsp), %edx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %ecx, %ecx
callq 0x13933
leaq 0xd0(%rsp), %rdi
callq 0x4970
movl 0x1d8(%rsp), %eax
movl 0x1d0(%rsp), %ecx
movl %eax, 0xd4(%rsp)
movl %ecx, 0xd0(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x4970
movl %ebp, 0x8(%rsp)
movl %ebx, 0xc(%rsp)
movabsq $0x1000000006, %rax     # imm = 0x1000000006
movq %rax, 0x160(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x4970
movl 0x1e8(%rsp), %eax
movl 0x1e0(%rsp), %ecx
movl %eax, 0x13c(%rsp)
movl %ecx, 0x138(%rsp)
movl 0x28(%rsp), %ebp
movl 0x2c(%rsp), %ebx
leaq 0xd0(%rsp), %rdi
callq 0x4b00
imull %ebp, %ebx
imull %eax, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
leaq 0xb0(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x38(%rsp), %rdi
leaq 0x90(%rsp), %rcx
movq %rbx, %rsi
callq 0x5ab3a
movl %r14d, %ebx
movq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0x28(%rsp), %r8d
movl 0x2c(%rsp), %r9d
leaq 0xd0(%rsp), %rdx
leaq 0x160(%rsp), %rcx
callq 0x5390
movl %eax, %ebp
leaq 0x1f799(%rip), %rsi     # 0x601dd
leaq 0x118(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x20c0
leaq 0x2292b(%rip), %rdx     # 0x63388
leaq 0x90(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x5a5df
leaq 0x20b4d(%rip), %rsi     # 0x615c6
leaq 0xf8(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x20c0
movq 0x100(%rsp), %r14
testq %r14, %r14
je 0x40ac6
leaq 0x20b27(%rip), %rsi     # 0x615c6
leaq 0x50(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x20c0
leaq 0x22cf0(%rip), %rsi     # 0x637a5
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x5a8d9
jmp 0x40adc
leaq 0x20af9(%rip), %rsi     # 0x615c6
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x20c0
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x5a61f
leaq 0xb0(%rsp), %rsi
movl %ebp, %edi
callq 0x13352
leaq 0xb0(%rsp), %rdi
callq 0x2270
leaq 0x70(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x40b2b
leaq 0x50(%rsp), %rdi
callq 0x2270
leaq 0xf8(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0x118(%rsp), %rdi
callq 0x2270
leaq 0x10(%rsp), %rbp
leaq 0x38(%rsp), %rsi
movq %rbp, %rdi
callq 0x12224
movb 0x1f0(%rsp), %al
movl 0x28(%rsp), %r10d
movl 0x2c(%rsp), %r11d
subq $0x8, %rsp
movzbl 0x200(%rsp), %r14d
movzbl %al, %eax
movl 0x10(%rsp), %edi
movl 0x14(%rsp), %esi
movl %ebx, %edx
movl %r13d, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
pushq %r14
pushq %rax
leaq 0x150(%rsp), %rax
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
pushq %r11
pushq %r10
pushq %rbp
callq 0x3efb9
addq $0x40, %rsp
leaq 0x38(%rsp), %rdi
callq 0xea7c
leaq 0x10(%rsp), %rdi
callq 0xea7c
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x40c09
movq %rax, %rbx
jmp 0x40c2c
movq %rax, %rbx
jmp 0x40c27
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x2270
jmp 0x40c1d
jmp 0x40c5f
jmp 0x40c5f
jmp 0x40c5f
jmp 0x40c5f
jmp 0x40c5f
movq %rax, %rbx
jmp 0x40c36
jmp 0x40c64
movq %rax, %rbx
jmp 0x40c50
movq %rax, %rbx
jmp 0x40c43
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2270
testq %r14, %r14
je 0x40c36
leaq 0x50(%rsp), %rdi
callq 0x2270
leaq 0xf8(%rsp), %rdi
callq 0x2270
leaq 0x90(%rsp), %rdi
callq 0x2270
leaq 0x118(%rsp), %rdi
callq 0x2270
jmp 0x40c67
movq %rax, %rbx
jmp 0x40c71
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xea7c
leaq 0x10(%rsp), %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x2380
movq %rax, %rdi
callq 0xe6cc