// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a8cc
movq %r14, %rdi
callq 0x1a9a6
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 0x1d948
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 0x1a45a
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 0x20c08
movq %rbx, %rdi
callq 0x1a5ec
movq %rax, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8d50c(%rip), %rsi     # 0xa51fd
leaq 0x8d52c(%rip), %rdx     # 0xa5224
movq %rsp, %rdi
callq 0xd14c
xorl %esi, %esi
cmpq $0x888, %r14            # imm = 0x888
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rdx
callq 0xbf80
leaq 0x8b95d(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x8d47c(%rip), %rsi     # 0xa51b7
movq %rax, %rdi
callq 0x1a3b8
leaq 0x8f50c(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
movq %rbx, %rdi
callq 0x1a5ec
cmpb $0x1, 0x188(%r15)
jne 0x17d76
movq %r15, %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0x2110
leaq 0x8b907(%rip), %rsi     # 0xa3684
movq %r15, %rdi
callq 0x18fba
leaq 0x8d48c(%rip), %rsi     # 0xa5218
movq %rax, %rdi
callq 0x190d2
leaq 0x8f4bb(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r15
cmpb $0x1, 0x188(%rax)
jne 0x17dc0
movq %r15, %rdi
addq $0x10, %rdi
movl $0x888, %esi            # imm = 0x888
callq 0x22f0
leaq 0xa24d2(%rip), %rsi     # 0xba299
movq %r15, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x17df5
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 0x1a45a
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 0x1f848
movq %rbx, %rdi
callq 0x1a5ec
movq %rax, %r14
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0x8d399(%rip), %rsi     # 0xa5225
leaq 0x8d3b6(%rip), %rdx     # 0xa5249
callq 0xd14c
xorl %esi, %esi
cmpq $0x7d, %r14
sete %sil
leaq 0xa0(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf80
leaq 0x8b7cb(%rip), %rsi     # 0xa3684
leaq 0xa0(%rsp), %rdi
callq 0x18fba
leaq 0x8d2ea(%rip), %rsi     # 0xa51b7
movq %rax, %rdi
callq 0x1a3b8
leaq 0x8f37a(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %r14
movq %rbx, %rdi
callq 0x1a5ec
cmpb $0x1, 0x188(%r14)
jne 0x17f08
movq %r14, %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0x2110
leaq 0x8b775(%rip), %rsi     # 0xa3684
movq %r14, %rdi
callq 0x18fba
leaq 0x8d322(%rip), %rsi     # 0xa5240
movq %rax, %rdi
callq 0x1902a
leaq 0x8f329(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x17f52
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x7d, %esi
callq 0x22f0
leaq 0xa2340(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x17f84
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x38(%rsp), %rdi
callq 0x1d848
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1800f
jmp 0x17fba
jmp 0x17fba
jmp 0x17fba
jmp 0x17fba
jmp 0x17fba
jmp 0x17fba
jmp 0x17fba
jmp 0x17fc3
jmp 0x17fd5
jmp 0x17fb5
movq %rax, %rbx
jmp 0x17fe5
movq %rax, %rbx
jmp 0x17ffb
jmp 0x17fc3
jmp 0x17fd5
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
jmp 0x17fe5
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xbfd8
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x17ffb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x38(%rsp), %rdi
callq 0x1d848
movq %rbx, %rdi
callq 0x2300
jmp 0x1800f
movq %rax, %rdi
callq 0xc0a9