// File: /workspace/github_cpp_makefile_star2_O1/dsharlet[P]array/test/array.cpp
// Function: nda::test_array_reshape_3d_body()
TEST(array_reshape_3d) {
  shape_of_rank<3> s({{-1, 10}, {-2, 10}, {-3, 10}});
  array_of_rank<int, 3> a(s);
  fill_pattern(a);

  a.reshape({{-2, 12}, {-3, 13}, {-4, 14}});
  check_pattern(a(s.x(), s.y(), s.z()));
  ASSERT_EQ(a.shape().flat_extent(), 12 * 13 * 14);

  a.reshape({5, 5, 5});
  check_pattern(a);
  ASSERT_EQ(a.shape().flat_extent(), 5 * 5 * 5);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c0, %rsp            # imm = 0x2C0
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
leaq 0x58(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, -0x18(%rbx)
movq $0x0, -0x8(%rbx)
movq $-0x3, (%rbx)
movl $0xa, %eax
movq %rax, 0x8(%rbx)
movq %r13, 0x10(%rbx)
movq $-0x2, 0x18(%rbx)
movq %rax, 0x20(%rbx)
movq %r13, 0x28(%rbx)
movq $-0x1, 0x30(%rbx)
movq %rax, 0x38(%rbx)
movq %r13, 0x40(%rbx)
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x1a362
movq %r14, %rdi
callq 0x1a43a
movq 0x18(%r14), %rcx
leaq 0xa8(%rsp), %rax
movq %rcx, -0x8(%rax)
movl $0x9, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x28(%rsp), %rcx
movl $0x0, (%rcx)
movq %rsp, %r14
movq %rcx, (%r14)
leaq 0xa0(%rsp), %r15
movq %r15, 0x8(%r14)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1d4b4
leaq 0x278(%rsp), %rsi
movq $-0x4, (%rsi)
movq $0xe, 0x8(%rsi)
movq %r13, 0x10(%rsi)
movq $-0x3, 0x18(%rsi)
movq $0xd, 0x20(%rsi)
movq %r13, 0x28(%rsi)
movq $-0x2, 0x30(%rsi)
movq $0xc, 0x38(%rsi)
movq %r13, 0x40(%rsi)
leaq 0x38(%rsp), %rdi
callq 0x19ee4
movq 0x98(%rsp), %rax
movq 0x80(%rsp), %rcx
movq 0x50(%rsp), %rdx
movq 0x68(%rsp), %rsi
movq 0x88(%rsp), %rdi
notq %rdi
imulq %rax, %rdi
movq $-0x2, %r8
movq $-0x2, %r9
subq 0x70(%rsp), %r9
imulq %rcx, %r9
movq $-0x3, %r10
movq $-0x3, %r11
subq 0x58(%rsp), %r11
imulq %rsi, %r11
testq %rdx, %rdx
leaq (%rdx,%r9,4), %r9
leaq (%r9,%rdi,4), %rdi
leaq (%rdi,%r11,4), %r9
cmoveq %rdx, %r9
leaq 0xa8(%rsp), %rdi
movq %r9, -0x8(%rdi)
movq %r10, (%rdi)
movl $0xa, %edx
movq %rdx, 0x8(%rdi)
movq %rsi, 0x10(%rdi)
movq %r8, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq $-0x1, 0x30(%rdi)
movq %rdx, 0x38(%rdi)
movq %rax, 0x40(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x28(%rsp), %rsi
movq %r15, (%rsi)
movq %r14, 0x8(%rsi)
callq 0x201f2
movq %rbx, %rdi
callq 0x1a076
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8ba67(%rip), %rsi     # 0xa31b5
leaq 0x8ba87(%rip), %rdx     # 0xa31dc
movq %rsp, %rdi
callq 0xd0b8
xorl %esi, %esi
cmpq $0x888, %r14            # imm = 0x888
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rdx
callq 0xbf0a
leaq 0x89ed0(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x8b9d7(%rip), %rsi     # 0xa316f
movq %rax, %rdi
callq 0x19e42
leaq 0x8db83(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %r15
movq %rbx, %rdi
callq 0x1a076
cmpb $0x1, 0x188(%r15)
jne 0x177d3
movq %r15, %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0x2110
leaq 0x89e7a(%rip), %rsi     # 0xa1654
movq %r15, %rdi
callq 0x18a16
leaq 0x8b9e7(%rip), %rsi     # 0xa31d0
movq %rax, %rdi
callq 0x18b2e
leaq 0x8db32(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x1781d
movq %r15, %rdi
addq $0x10, %rdi
movl $0x888, %esi            # imm = 0x888
callq 0x22f0
leaq 0xa0b45(%rip), %rsi     # 0xb8369
movq %r15, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x17852
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
xorl %eax, %eax
leaq 0x230(%rsp), %rsi
movq %rax, (%rsi)
movl $0x5, %ecx
movq %rcx, 0x8(%rsi)
movq %r13, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movq %rcx, 0x20(%rsi)
movq %r13, 0x28(%rsi)
movq %rax, 0x30(%rsi)
movq %rcx, 0x38(%rsi)
movq %r13, 0x40(%rsi)
leaq 0x38(%rsp), %rdi
callq 0x19ee4
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x50(%rsp), %rcx
leaq 0xa8(%rsp), %rax
movq %rcx, -0x8(%rax)
movl $0x9, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x28(%rsp), %rsi
movq %r15, (%rsi)
movq %r14, 0x8(%rsi)
movq %rax, %rdi
callq 0x1eda4
movq %rbx, %rdi
callq 0x1a076
movq %rax, %r14
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0x8b8f4(%rip), %rsi     # 0xa31dd
leaq 0x8b911(%rip), %rdx     # 0xa3201
callq 0xd0b8
xorl %esi, %esi
cmpq $0x7d, %r14
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x89d3e(%rip), %rsi     # 0xa1654
leaq 0xa0(%rsp), %rdi
callq 0x18a16
leaq 0x8b845(%rip), %rsi     # 0xa316f
movq %rax, %rdi
callq 0x19e42
leaq 0x8d9f1(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %r14
movq %rbx, %rdi
callq 0x1a076
cmpb $0x1, 0x188(%r14)
jne 0x17965
movq %r14, %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0x2110
leaq 0x89ce8(%rip), %rsi     # 0xa1654
movq %r14, %rdi
callq 0x18a16
leaq 0x8b87d(%rip), %rsi     # 0xa31f8
movq %rax, %rdi
callq 0x18a86
leaq 0x8d9a0(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x179af
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x7d, %esi
callq 0x22f0
leaq 0xa09b3(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x179e1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x38(%rsp), %rdi
callq 0x1d3b4
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x17a6c
jmp 0x17a17
jmp 0x17a17
jmp 0x17a17
jmp 0x17a17
jmp 0x17a17
jmp 0x17a17
jmp 0x17a17
jmp 0x17a20
jmp 0x17a32
jmp 0x17a12
movq %rax, %rbx
jmp 0x17a42
movq %rax, %rbx
jmp 0x17a58
jmp 0x17a20
jmp 0x17a32
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
jmp 0x17a42
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x17a58
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x38(%rsp), %rdi
callq 0x1d3b4
movq %rbx, %rdi
callq 0x2300
jmp 0x17a6c
movq %rax, %rdi
callq 0xc036