// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
leaq 0x108(%rsp), %rsi
movq $-0x3, (%rsi)
pushq $0xa
popq %rax
movq %rax, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq $-0x2, 0x18(%rsi)
movq %rax, 0x20(%rsi)
movq %r14, 0x28(%rsi)
orq $-0x1, 0x30(%rsi)
movq %rax, 0x38(%rsi)
movq %r14, 0x40(%rsi)
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x10b92
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10bbd
leaq 0x2e0(%rsp), %rsi
movq $-0x4, (%rsi)
movq $0xe, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq $-0x3, 0x18(%rsi)
movq $0xd, 0x20(%rsi)
movq %r14, 0x28(%rsi)
movq $-0x2, 0x30(%rsi)
movq $0xc, 0x38(%rsi)
movq %r14, 0x40(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x11a8a
leaq 0x120(%rsp), %rax
movq 0x28(%rax), %rdx
leaq 0x10(%rsp), %rcx
movq %rdx, 0x40(%rcx)
movups 0x18(%rax), %xmm0
movaps %xmm0, 0x30(%rcx)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rcx)
movq 0x10(%rax), %rdx
movq %rdx, 0x28(%rcx)
movups -0x18(%rax), %xmm0
movaps %xmm0, (%rcx)
movq -0x8(%rax), %rax
movq %rax, 0x10(%rcx)
leaq 0x78(%rsp), %rbx
movq -0x8(%rbx), %rsi
leaq 0x150(%rsp), %rdi
movq %rbx, %rdx
callq 0x1379a
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x150(%rsp), %rdi
callq 0x11b66
movq %rbx, %rdi
callq 0x11b88
movq %rax, %r14
leaq 0x7fcef(%rip), %rsi     # 0x8f4ce
leaq 0x10(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x888, %r14            # imm = 0x888
sete %sil
leaq 0x150(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x6894
leaq 0x7de33(%rip), %rsi     # 0x8d647
leaq 0x150(%rsp), %rdi
callq 0x106fe
leaq 0x7fc60(%rip), %rsi     # 0x8f488
movq %rax, %rdi
callq 0x11a32
leaq 0x81dbb(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %r14
movq %rbx, %rdi
callq 0x11b88
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x11052
leaq 0x7dde6(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x7fc79(%rip), %rsi     # 0x8f4e9
movq %rax, %rdi
callq 0x1082e
leaq 0x81d73(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x4(%rsp), %rsi
movl $0x888, (%rsi)          # imm = 0x888
movq %rax, %rdi
callq 0x10736
leaq 0x95a01(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x150(%rsp), %rdi
callq 0x68d4
leaq 0x10(%rsp), %rdi
callq 0x2090
leaq 0xc0(%rsp), %rdi
pushq $0x5
popq %rcx
movl %ecx, %esi
movl %ecx, %edx
callq 0x10b74
leaq 0x58(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x11a8a
xorps %xmm0, %xmm0
leaq 0x150(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x113b4
movq %rbx, %rdi
callq 0x11b88
movq %rax, %r14
leaq 0x7fbe1(%rip), %rsi     # 0x8f4f6
leaq 0x10(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x7d, %r14
sete %sil
leaq 0x150(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x6894
leaq 0x7dd00(%rip), %rsi     # 0x8d647
leaq 0x150(%rsp), %rdi
callq 0x106fe
leaq 0x7fb2d(%rip), %rsi     # 0x8f488
movq %rax, %rdi
callq 0x11a32
leaq 0x81c88(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq %rax, %r14
movq %rbx, %rdi
callq 0x11b88
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x11052
leaq 0x7dcb3(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x7fb6e(%rip), %rsi     # 0x8f511
movq %rax, %rdi
callq 0x1079e
leaq 0x81c40(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x4(%rsp), %rsi
movl $0x7d, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x958ce(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x150(%rsp), %rdi
callq 0x68d4
leaq 0x10(%rsp), %rdi
callq 0x2090
leaq 0x58(%rsp), %rdi
callq 0x10d02
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r14
retq
jmp 0xfa25
jmp 0xfa25
jmp 0xfa25
jmp 0xfa25
jmp 0xfa25
jmp 0xfa25
jmp 0xfa25
jmp 0xfa25
jmp 0xfa2c
jmp 0xfa1e
jmp 0xfa3e
movq %rax, %rbx
jmp 0xfa4e
jmp 0xfa2c
movq %rax, %rbx
jmp 0xfa58
jmp 0xfa3e
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x68d4
jmp 0xfa4e
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x68d4
leaq 0x10(%rsp), %rdi
callq 0x2090
leaq 0x58(%rsp), %rdi
callq 0x10d02
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba