// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/image.cpp
// Function: nda::test_image_chunky_padded_body()
TEST(image_chunky_padded) {
  chunky_image<int, 4> src({40, 30, {}});
  fill_pattern(src);
  chunky_image<int, 4> dest(src.shape(), 5);

  chunky_image_ref<const int, 3, 4> src_rgb(src.base(), {src.width(), src.height(), 3});
  chunky_image_ref<int, 3, 4> dest_rgb(dest.base(), {src.width(), src.height(), 3});
  copy(src_rgb, dest_rgb);

  for (int y = 0; y < dest.height(); y++) {
    for (int x = 0; x < dest.width(); x++) {
      ASSERT_EQ(dest(x, y, 0), src(x, y, 0));
      ASSERT_EQ(dest(x, y, 1), src(x, y, 1));
      ASSERT_EQ(dest(x, y, 2), src(x, y, 2));
      // The channel corresponding to padding should not have been
      // overwritten by the pattern.
      ASSERT_EQ(dest(x, y, 3), 5);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
leaq 0x80(%rsp), %rbx
andq $0x0, (%rbx)
leaq 0x118(%rsp), %r14
andq $0x0, (%r14)
movq $0x28, 0x8(%rbx)
movq $0x1e, 0x8(%r14)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%r14)
leaq 0xd8(%rsp), %r15
movq %r15, %rdi
callq 0x510a4
leaq 0x158(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x510ac
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x51118
movq %rbx, %rdi
xorl %esi, %esi
callq 0x51155
leaq 0x48(%rsp), %rsi
leaq 0x158(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0x80(%rsp), %rdi
callq 0x51192
movq 0x40(%rsp), %rbx
movq 0x58(%rsp), %rdx
movq 0x70(%rsp), %rsi
leaq 0x158(%rsp), %rdi
pushq $0x3
popq %rcx
callq 0x511f6
leaq 0x120(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movups 0x158(%rsp), %xmm0
movups 0x168(%rsp), %xmm1
movups 0x178(%rsp), %xmm2
movups %xmm0, (%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm2, 0x20(%rdi)
movq 0x188(%rsp), %rax
movq %rax, 0x30(%rdi)
callq 0x64388
movq 0x98(%rsp), %rbx
movq 0x58(%rsp), %rdx
movq 0x70(%rsp), %rsi
leaq 0x158(%rsp), %rdi
pushq $0x3
popq %rcx
callq 0x511f6
leaq 0xe0(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movups 0x158(%rsp), %xmm0
movups 0x168(%rsp), %xmm1
movups 0x178(%rsp), %xmm2
movups %xmm0, (%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm2, 0x20(%rdi)
movq 0x188(%rsp), %rax
movq %rax, 0x30(%rdi)
callq 0x64388
leaq 0x118(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x51214
xorl %ebx, %ebx
leaq 0x80(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x158(%rsp), %r13
cmpq %rbx, 0xb0(%rsp)
jle 0x4d610
xorl %r14d, %r14d
cmpq %r14, 0xc8(%rsp)
jle 0x4d608
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x512e0
movl (%rax), %ebp
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x512e0
movl (%rax), %r15d
movq %r12, %rdi
leaq 0x519e5(%rip), %rsi     # 0x9ebe6
movq %rsp, %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %r15d, %ebp
sete %sil
movq %r13, %rdi
movq %r13, %rbp
movq %r12, %rdx
callq 0x6894
leaq 0x80(%rsp), %r15
pushq $0x1
popq %r12
movq %rbp, %r13
movq %rbp, %rdi
leaq 0x4040e(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x519bc(%rip), %rsi     # 0x9ec04
callq 0x1085e
movq %rax, %rdi
leaq 0x4439b(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x403c4(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x51965(%rip), %rsi     # 0x9ebf7
callq 0x1082e
movq %rax, %rdi
leaq 0x44351(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x57fd3(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r13, %rdi
callq 0x68d4
leaq 0x8(%rsp), %rdi
callq 0x2090
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x512e0
movl (%rax), %ebp
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x512e0
movl (%rax), %r15d
leaq 0x8(%rsp), %r12
movq %r12, %rdi
leaq 0x518f6(%rip), %rsi     # 0x9ec12
movq %rsp, %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %r15d, %ebp
sete %sil
movq %r13, %rbp
movq %r13, %rdi
movq %r12, %rdx
callq 0x6894
leaq 0x80(%rsp), %r15
pushq $0x1
popq %r12
movq %rbp, %rdi
leaq 0x402f6(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x518d0(%rip), %rsi     # 0x9ec30
callq 0x1085e
movq %rax, %rdi
leaq 0x44283(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x402ab(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x51878(%rip), %rsi     # 0x9ec23
callq 0x1082e
movq %rax, %rdi
leaq 0x44238(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x57eb9(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r13, %rdi
callq 0x68d4
leaq 0x8(%rsp), %rdi
callq 0x2090
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x2
popq %r15
movl %r15d, %ecx
callq 0x512e0
movl (%rax), %ebp
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
movl %r15d, %ecx
callq 0x512e0
movl (%rax), %r15d
leaq 0x8(%rsp), %r12
movq %r12, %rdi
leaq 0x51804(%rip), %rsi     # 0x9ec3e
movq %rsp, %rdx
callq 0x66a0
xorl %esi, %esi
cmpl %r15d, %ebp
sete %sil
movq %r13, %rbp
movq %r13, %rdi
movq %r12, %rdx
callq 0x6894
leaq 0x80(%rsp), %r15
movq %rbp, %rdi
leaq 0x401dc(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x517e2(%rip), %rsi     # 0x9ec5c
callq 0x1085e
movq %rax, %rdi
leaq 0x44169(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x2
popq %rcx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x40191(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x5178a(%rip), %rsi     # 0x9ec4f
callq 0x1082e
movq %rax, %rdi
leaq 0x4411e(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x2
popq %rcx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x57d9f(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r13, %rdi
callq 0x68d4
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x2090
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x3
popq %rcx
callq 0x512e0
movl (%rax), %ebp
movq %r12, %rdi
leaq 0x51731(%rip), %rsi     # 0x9ec6a
leaq 0x7(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl $0x5, %ebp
sete %sil
movq %r13, %rdi
movq %r12, %rdx
callq 0x6894
movq %r13, %rdi
leaq 0x400e6(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x5170d(%rip), %rsi     # 0x9ec7d
callq 0x1085e
movq %rax, %rdi
leaq 0x44073(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %rbp
movq %r15, %rdi
movl %r14d, %esi
movl %ebx, %edx
pushq $0x3
popq %rcx
callq 0x512e0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x4009b(%rip), %rsi     # 0x8d647
callq 0x106fe
movq %rax, %rdi
leaq 0x41f5e(%rip), %rsi     # 0x8f519
callq 0x106fe
movq %rax, %rdi
leaq 0x44028(%rip), %rsi     # 0x915f2
callq 0x106fe
movl $0x5, (%rsp)
movq %rax, %rdi
movq %rsp, %rsi
callq 0x10736
movq %rax, %rdi
leaq 0x57cb7(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r13, %rdi
callq 0x68d4
movq %r12, %rdi
callq 0x2090
incq %r14
jmp 0x4d1c4
incq %rbx
jmp 0x4d1b3
leaq 0x80(%rsp), %rdi
callq 0x512f4
leaq 0x28(%rsp), %rdi
callq 0x512f4
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d664
jmp 0x4d63d
movq %rax, %rbx
jmp 0x4d6c6
jmp 0x4d664
jmp 0x4d664
jmp 0x4d664
jmp 0x4d664
jmp 0x4d664
jmp 0x4d664
jmp 0x4d664
jmp 0x4d669
jmp 0x4d65f
jmp 0x4d65f
jmp 0x4d65f
jmp 0x4d664
jmp 0x4d664
movq %rax, %rbx
jmp 0x4d6af
movq %rax, %rbx
jmp 0x4d6b9
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x68d4
jmp 0x4d6af
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x68d4
jmp 0x4d6af
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x68d4
jmp 0x4d6af
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x68d4
leaq 0x8(%rsp), %rdi
callq 0x2090
leaq 0x80(%rsp), %rdi
callq 0x512f4
leaq 0x28(%rsp), %rdi
callq 0x512f4
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba