// File: /workspace/github_cpp_makefile_star2_O1/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 0x75a95
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 0x75adc
movq %r14, %rdi
callq 0x75b96
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 0x75dda
leaq 0x98(%rsp), %rsi
leaq 0x158(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0x20(%rsp), %rdi
callq 0x5f8ee
movq 0x90(%rsp), %rbx
movq 0xa8(%rsp), %rdx
movq 0xc0(%rsp), %rsi
leaq 0x158(%rsp), %rdi
movl $0x3, %ecx
callq 0x5f99c
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 0x5a8cf
leaq 0xe0(%rsp), %rsi
movq 0x10(%rsi), %rdi
callq 0x760de
movq %rax, 0xf8(%rsp)
movq 0x38(%rsp), %rbx
movq 0xa8(%rsp), %rdx
movq 0xc0(%rsp), %rsi
leaq 0x158(%rsp), %rdi
movl $0x3, %ecx
callq 0x5f99c
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 0x5a961
leaq 0x120(%rsp), %rsi
movq 0x10(%rsi), %rdi
callq 0x760de
movq %rax, 0x138(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x5fa13
cmpq $0x0, 0x50(%rsp)
jle 0x5b026
xorl %ebp, %ebp
movq %rsp, %r12
cmpq $0x0, 0x68(%rsp)
jle 0x5b018
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 0x57124(%rip), %rsi     # 0xb1b36
leaq 0x5713a(%rip), %rdx     # 0xb1b53
callq 0xd0b8
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %r13
movq %r12, %rdx
callq 0xbf0a
leaq 0x46c10(%rip), %r12     # 0xa1654
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x570fb(%rip), %rsi     # 0xb1b54
callq 0x18b66
movq %rax, %rdi
leaq 0x4a8c2(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5aaad
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 0x18a16
movq %rax, %rdi
leaq 0x57085(%rip), %rsi     # 0xb1b47
callq 0x18b2e
movq %rax, %rdi
leaq 0x4a859(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5ab22
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 0x5d83d(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5ab54
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 0x56f9c(%rip), %rsi     # 0xb1b62
leaq 0x56fb2(%rip), %rdx     # 0xb1b7f
callq 0xd0b8
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0xbf0a
leaq 0x46a5f(%rip), %r12     # 0xa1654
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x56f76(%rip), %rsi     # 0xb1b80
callq 0x18b66
movq %rax, %rdi
leaq 0x4a711(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5ac5e
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 0x18a16
movq %rax, %rdi
leaq 0x56f00(%rip), %rsi     # 0xb1b73
callq 0x18b2e
movq %rax, %rdi
leaq 0x4a6a8(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5acd3
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 0x5d68c(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5ad05
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 0x56e17(%rip), %rsi     # 0xb1b8e
leaq 0x56e2d(%rip), %rdx     # 0xb1bab
callq 0xd0b8
xorl %esi, %esi
cmpl %ebx, %r14d
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0xbf0a
leaq 0x468ae(%rip), %r12     # 0xa1654
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x56df1(%rip), %rsi     # 0xb1bac
callq 0x18b66
movq %rax, %rdi
leaq 0x4a560(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5ae0f
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 0x18a16
movq %rax, %rdi
leaq 0x56d7b(%rip), %rsi     # 0xb1b9f
callq 0x18b2e
movq %rax, %rdi
leaq 0x4a4f7(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5ae84
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 0x5d4db(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5aeb6
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 0x56cc7(%rip), %rsi     # 0xb1bba
leaq 0x56cd2(%rip), %rdx     # 0xb1bcc
callq 0xd0b8
xorl %esi, %esi
cmpl $0x5, %ebx
sete %sil
leaq 0x158(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
callq 0xbf0a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x56c9d(%rip), %rsi     # 0xb1bcd
callq 0x18b66
movq %rax, %rdi
leaq 0x4a3eb(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5af83
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 0x18a16
movq %rax, %rdi
leaq 0x48268(%rip), %rsi     # 0xa3200
callq 0x18a16
movq %rax, %rdi
leaq 0x4a383(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x5afc9
movq %r14, %rdi
addq $0x10, %rdi
movl $0x5, %esi
callq 0x22f0
movq %r14, %rdi
leaq 0x5d396(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
movq 0xd0(%rsp), %rbx
je 0x5b003
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %rbx
addq $0x10, %r15
cmpq %rbx, 0x68(%rsp)
movq %r13, %r12
jg 0x5a99b
incq %rbp
cmpq %rbp, 0x50(%rsp)
jg 0x5a987
leaq 0x20(%rsp), %rdi
callq 0x75cd2
leaq 0x78(%rsp), %rdi
callq 0x75cd2
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5b0ff
jmp 0x5b0ff
jmp 0x5b06c
jmp 0x5b05a
movq %rax, %rbx
jmp 0x5b0e9
jmp 0x5b06c
jmp 0x5b06c
jmp 0x5b06c
jmp 0x5b06c
jmp 0x5b06c
movq %rax, %rbx
jmp 0x5b0df
jmp 0x5b07e
jmp 0x5b079
jmp 0x5b079
jmp 0x5b079
movq %rax, %rbx
jmp 0x5b0c4
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbf62
jmp 0x5b0c4
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbf62
jmp 0x5b0c4
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbf62
jmp 0x5b0c4
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5b0df
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x75cd2
leaq 0x78(%rsp), %rdi
callq 0x75cd2
movq %rbx, %rdi
callq 0x2300
jmp 0x5b0ff
jmp 0x5b0ff
movq %rax, %rdi
callq 0xc036