// File: /workspace/github_cpp_makefile_star2_O3/dsharlet[P]array/test/shape.cpp
// Function: nda::test_for_each_index_3d_body()
TEST(for_each_index_3d) {
  dense_shape<3> s(3, 5, 8);
  s.resolve();
  int expected_flat_offset = 0;
  move_only token;
  for_each_index(s, [&, token = std::move(token)](auto i) {
    ASSERT_EQ(s[i], expected_flat_offset);
    expected_flat_offset++;
    assert_used(token);
  });
  // Ensure the for_each_index loop above actually ran.
  ASSERT_EQ(expected_flat_offset, 120);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
xorl %r15d, %r15d
leaq 0xa8(%rsp), %rsi
movq %r15, (%rsi)
movl $0x3, %ebx
movq %rbx, 0x8(%rsi)
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq %r14, 0x10(%rsi)
xorl %edi, %edi
callq 0xd133
leaq 0x78(%rsp), %rsi
movq %r15, -0x18(%rsi)
movq $0x8, -0x10(%rsi)
movq %r14, -0x8(%rsi)
movq %r15, (%rsi)
movq $0x5, 0x8(%rsi)
movq %r14, 0x10(%rsi)
movq %r15, 0x18(%rsi)
movq %rbx, 0x20(%rsi)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0xc573
leaq 0x4(%rsp), %rax
movl $0x0, (%rax)
movq %rbx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x88464
movq 0x60(%rsp), %rcx
movq %rcx, 0x8(%rsp)
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x88440
movq 0x78(%rsp), %rbx
addq %rbx, 0x30(%rsp)
movq 0x98(%rsp), %r12
testq %r12, %r12
je 0x88432
movq 0x90(%rsp), %rbp
movq 0x48(%rsp), %rax
movq 0x8(%rsp), %rcx
subq (%rax), %rcx
imulq 0x10(%rax), %rcx
movq %rbx, %r13
subq 0x18(%rax), %r13
imulq 0x28(%rax), %r13
movq 0x50(%rsp), %rdx
addq %rcx, %r13
subq 0x30(%rax), %r13
addq %rbp, %r13
movslq (%rdx), %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x1c, 0x38(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x37e4d(%rip), %xmm0    # 0xc013f
movups %xmm0, 0xc(%rax)
movups 0x37e36(%rip), %xmm0    # 0xc0133
movups %xmm0, (%rax)
movq %rcx, 0x18(%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%rcx)
xorl %esi, %esi
cmpq %r14, %r13
sete %sil
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rdx
callq 0xbf80
leaq 0x1b353(%rip), %r15     # 0xa3684
movq %r14, %rdi
movq %r15, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x374a5(%rip), %rsi     # 0xbf7eb
callq 0x18ff2
movq %rax, %rdi
leaq 0x1ef01(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0x8839a
movq 0x48(%rsp), %rax
movq 0x8(%rsp), %rcx
subq (%rax), %rcx
imulq 0x10(%rax), %rcx
movq %rbx, %rsi
subq 0x18(%rax), %rsi
imulq 0x28(%rax), %rsi
addq %rcx, %rsi
subq 0x30(%rax), %rsi
addq %rbp, %rsi
movq %r13, %rdi
addq $0x10, %rdi
callq 0x21b0
movq %r13, %rdi
movq %r15, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x37dc9(%rip), %rsi     # 0xc0178
callq 0x4ace2
movq %rax, %rdi
leaq 0x1ee98(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0x883e2
movq 0x50(%rsp), %rax
movq %r13, %rdi
addq $0x10, %rdi
movl (%rax), %esi
callq 0x22f0
movq %r13, %rdi
leaq 0x31ead(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r14, %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x88415
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x50(%rsp), %rax
incl (%rax)
leaq 0x40(%rsp), %rdi
callq 0x203cc
incq %rbp
decq %r12
jne 0x88285
incq %rbx
cmpq 0x30(%rsp), %rbx
jne 0x8826c
movq 0x8(%rsp), %rcx
incq %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x8(%rsp)
cmpq %rax, %rcx
jne 0x8824c
cmpl $0x78, 0x4(%rsp)
sete %r15b
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x36a93(%rip), %rsi     # 0xbef07
leaq 0x36aa7(%rip), %rdx     # 0xbef22
leaq 0x10(%rsp), %rdi
callq 0xd14c
movzbl %r15b, %esi
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xbf80
leaq 0x1b1e2(%rip), %rsi     # 0xa3684
leaq 0xa8(%rsp), %rdi
callq 0x18fba
leaq 0x37cc2(%rip), %rsi     # 0xc0178
movq %rax, %rdi
callq 0x4ace2
leaq 0x1ed91(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x884e9
movq %rbx, %rdi
addq $0x10, %rdi
movl 0x4(%rsp), %esi
callq 0x22f0
leaq 0x1b194(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x36a20(%rip), %rsi     # 0xbef1f
movq %rax, %rdi
callq 0x19a02
leaq 0x1ed48(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x88533
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x78, %esi
callq 0x22f0
leaq 0x31d5f(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xa8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x88566
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x885d5
jmp 0x88584
movq %rax, %rbx
jmp 0x88594
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x885c8
jmp 0x885d5
jmp 0x885dd
movq %rax, %rbx
jmp 0x885b9
jmp 0x885a9
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x885d5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9