// File: /workspace/github_cpp_makefile_star2_O3/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
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
xorl %r12d, %r12d
leaq 0x158(%rsp), %rbx
movq %r12, 0x8(%rbx)
movq $0x1e, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movq %r12, 0x20(%rbx)
movq $0x28, 0x28(%rbx)
movq %rbx, %rdi
callq 0x770ff
movq 0x30(%rbx), %rax
leaq 0x78(%rsp), %r14
movq %rax, 0x50(%r14)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm2, 0x40(%r14)
movups %xmm1, 0x30(%r14)
movups %xmm0, 0x20(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %r12, 0x18(%r14)
movq %r14, %rdi
callq 0x77146
movq %r14, %rdi
callq 0x77210
movq 0x18(%r14), %rax
movq %rax, (%rbx)
leaq 0x160(%rsp), %rdi
movups 0x20(%r14), %xmm0
movups %xmm0, (%rdi)
movups 0x30(%r14), %xmm0
movups %xmm0, 0x10(%rdi)
movups 0x40(%r14), %xmm0
movups %xmm0, 0x20(%rdi)
movq 0x50(%r14), %rax
movq %rax, 0x30(%rdi)
leaq 0xd8(%rsp), %rax
movl $0x0, (%rax)
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, 0x8(%rsi)
callq 0x7745d
leaq 0x98(%rsp), %rsi
leaq 0x158(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0x20(%rsp), %rdi
callq 0x60e32
movq 0x90(%rsp), %rbx
movq 0xa8(%rsp), %rdx
movq 0xc0(%rsp), %rsi
leaq 0x158(%rsp), %rdi
movl $0x3, %ecx
callq 0x60ee0
movq %rbx, 0xd8(%rsp)
movups 0x158(%rsp), %xmm0
movups 0x168(%rsp), %xmm1
movups 0x178(%rsp), %xmm2
movups %xmm1, 0xf0(%rsp)
movups %xmm0, 0xe0(%rsp)
movups %xmm2, 0x100(%rsp)
movq 0x188(%rsp), %rax
movq %rax, 0x110(%rsp)
cmpq %r15, 0xf8(%rsp)
jne 0x5be67
leaq 0xe0(%rsp), %rsi
movq 0x10(%rsi), %rdi
callq 0x778b7
movq %rax, 0xf8(%rsp)
movq 0x38(%rsp), %rbx
movq 0xa8(%rsp), %rdx
movq 0xc0(%rsp), %rsi
leaq 0x158(%rsp), %rdi
movl $0x3, %ecx
callq 0x60ee0
movq %rbx, 0x118(%rsp)
movups 0x158(%rsp), %xmm0
movups 0x168(%rsp), %xmm1
movups 0x178(%rsp), %xmm2
movups %xmm1, 0x130(%rsp)
movups %xmm0, 0x120(%rsp)
movups %xmm2, 0x140(%rsp)
movq 0x188(%rsp), %rax
movq %rax, 0x150(%rsp)
cmpq %r15, 0x138(%rsp)
jne 0x5bef9
leaq 0x120(%rsp), %rsi
movq 0x10(%rsi), %rdi
callq 0x778b7
movq %rax, 0x138(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x60f57
movq 0x50(%rsp), %rcx
testq %rcx, %rcx
jle 0x5c5c8
movq 0x68(%rsp), %rax
xorl %ebp, %ebp
movq %rsp, %r12
testq %rax, %rax
jle 0x5c5bc
movl $0xc, %r15d
xorl %ebx, %ebx
movq %rbx, 0xd0(%rsp)
movq %rbp, %rax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movl -0xc(%r15,%rax), %r14d
movq %rbp, %rax
subq 0xa0(%rsp), %rax
imulq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x90(%rsp), %rax
movl -0xc(%r15,%rax), %ebx
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq 0x57ab8(%rip), %rsi     # 0xb3a66
leaq 0x57ace(%rip), %rdx     # 0xb3a83
callq 0xd14c
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %r13
movq %r12, %rdx
callq 0xbf80
leaq 0x476a4(%rip), %r12     # 0xa3684
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x57a8f(%rip), %rsi     # 0xb3a84
callq 0x1910a
movq %rax, %rdi
leaq 0x4b252(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c049
movq %rbp, %rax
subq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x58(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl -0xc(%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x57a19(%rip), %rsi     # 0xb3a77
callq 0x190d2
movq %rax, %rdi
leaq 0x4b1e9(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c0be
movq %rbp, %rax
subq 0xa0(%rsp), %rax
movq 0xb8(%rsp), %rcx
imulq 0xb0(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x90(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl -0xc(%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x5e1d1(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5c0f0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbp, %rax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movl -0x8(%r15,%rax), %r14d
movq %rbp, %rax
subq 0xa0(%rsp), %rax
imulq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x90(%rsp), %rax
movl -0x8(%r15,%rax), %ebx
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %r12
movq %r13, %rdi
leaq 0x57930(%rip), %rsi     # 0xb3a92
leaq 0x57946(%rip), %rdx     # 0xb3aaf
callq 0xd14c
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0xbf80
leaq 0x474f3(%rip), %r12     # 0xa3684
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x5790a(%rip), %rsi     # 0xb3ab0
callq 0x1910a
movq %rax, %rdi
leaq 0x4b0a1(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c1fa
movq %rbp, %rax
subq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x58(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl -0x8(%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x57894(%rip), %rsi     # 0xb3aa3
callq 0x190d2
movq %rax, %rdi
leaq 0x4b038(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c26f
movq %rbp, %rax
subq 0xa0(%rsp), %rax
movq 0xb8(%rsp), %rcx
imulq 0xb0(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x90(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl -0x8(%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x5e020(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5c2a1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbp, %rax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movl -0x4(%r15,%rax), %r14d
movq %rbp, %rax
subq 0xa0(%rsp), %rax
imulq 0xb0(%rsp), %rax
movq 0xb8(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x90(%rsp), %rax
movl -0x4(%r15,%rax), %ebx
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %r12
movq %r13, %rdi
leaq 0x577ab(%rip), %rsi     # 0xb3abe
leaq 0x577c1(%rip), %rdx     # 0xb3adb
callq 0xd14c
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0xbf80
leaq 0x47342(%rip), %r12     # 0xa3684
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x57785(%rip), %rsi     # 0xb3adc
callq 0x1910a
movq %rax, %rdi
leaq 0x4aef0(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c3ab
movq %rbp, %rax
subq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x58(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl -0x4(%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x5770f(%rip), %rsi     # 0xb3acf
callq 0x190d2
movq %rax, %rdi
leaq 0x4ae87(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c420
movq %rbp, %rax
subq 0xa0(%rsp), %rax
movq 0xb8(%rsp), %rcx
imulq 0xb0(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x90(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl -0x4(%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x5de6f(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5c452
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbp, %rax
subq 0x48(%rsp), %rax
imulq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movl (%r15,%rax), %ebx
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %r14
movq %r13, %rdi
leaq 0x5765b(%rip), %rsi     # 0xb3aea
leaq 0x57666(%rip), %rdx     # 0xb3afc
callq 0xd14c
xorl %esi, %esi
cmpl $0x5, %ebx
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xbf80
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x57631(%rip), %rsi     # 0xb3afd
callq 0x1910a
movq %rax, %rdi
leaq 0x4ad7b(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c51f
movq %rbp, %rax
subq 0x48(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x58(%rsp), %rax
shlq $0x2, %rax
shlq $0x4, %rcx
subq %rcx, %rax
addq 0x38(%rsp), %rax
movq %r14, %rdi
addq $0x10, %rdi
movl (%r15,%rax), %esi
callq 0x22f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x48d14(%rip), %rsi     # 0xa5248
callq 0x18fba
movq %rax, %rdi
leaq 0x4ad13(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5c565
movq %r14, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x5dd2a(%rip), %rsi     # 0xba299
callq 0x18fba
movq %rbx, %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
movq 0xd0(%rsp), %rbx
je 0x5c59f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %rbx
movq 0x68(%rsp), %rax
addq $0x10, %r15
cmpq %rbx, %rax
movq %r13, %r12
jg 0x5bf37
movq 0x50(%rsp), %rcx
incq %rbp
cmpq %rbp, %rcx
jg 0x5bf26
leaq 0x20(%rsp), %rdi
callq 0x7734c
leaq 0x78(%rsp), %rdi
callq 0x7734c
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5c6a1
jmp 0x5c6a1
jmp 0x5c60e
jmp 0x5c5fc
movq %rax, %rbx
jmp 0x5c68b
jmp 0x5c60e
jmp 0x5c60e
jmp 0x5c60e
jmp 0x5c60e
jmp 0x5c60e
movq %rax, %rbx
jmp 0x5c681
jmp 0x5c620
jmp 0x5c61b
jmp 0x5c61b
jmp 0x5c61b
movq %rax, %rbx
jmp 0x5c666
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbfd8
jmp 0x5c666
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbfd8
jmp 0x5c666
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbfd8
jmp 0x5c666
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5c681
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x7734c
leaq 0x78(%rsp), %rdi
callq 0x7734c
movq %rbx, %rdi
callq 0x2300
jmp 0x5c6a1
jmp 0x5c6a1
movq %rax, %rdi
callq 0xc0a9