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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
xorl %r15d, %r15d
leaq 0xc8(%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 0x98(%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 0x80(%rsp), %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0xc573
leaq 0xc(%rsp), %rax
movl $0x0, (%rax)
movq %rbx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x86f27
movq 0x80(%rsp), %rdx
movq %rdx, 0x30(%rsp)
addq %rdx, %rax
movq %rax, 0x78(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x86f03
movq 0x98(%rsp), %rcx
movq %rcx, 0x38(%rsp)
addq %rcx, 0x40(%rsp)
movslq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rbx
testq %rbx, %rbx
je 0x86eeb
movq 0xb0(%rsp), %r15
movslq 0x38(%rsp), %rax
movq %rax, 0x50(%rsp)
shlq $0x20, %r15
movq %r15, %r12
sarq $0x20, %r12
movq 0x68(%rsp), %rax
movq %r12, %rcx
subq 0x30(%rax), %rcx
movq 0x70(%rsp), %rdx
movq 0x50(%rsp), %rsi
subq 0x18(%rax), %rsi
imulq 0x28(%rax), %rsi
addq %rcx, %rsi
movq 0x48(%rsp), %r13
subq (%rax), %r13
imulq 0x10(%rax), %r13
addq %rsi, %r13
movslq (%rdx), %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x22, 0x58(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x39339(%rip), %xmm0    # 0xc00d7
movups %xmm0, (%rax)
movups 0x3933f(%rip), %xmm0    # 0xc00e7
movups %xmm0, 0x10(%rax)
movw $0x7465, 0x20(%rax)     # imm = 0x7465
movq %rcx, 0x18(%rsp)
movb $0x0, (%rax,%rcx)
xorl %esi, %esi
cmpq %r14, %r13
sete %sil
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rdx
callq 0xbf80
leaq 0x1c8a6(%rip), %rbp     # 0xa3684
movq %r14, %rdi
movq %rbp, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x39307(%rip), %rsi     # 0xc00fa
callq 0x19062
movq %rax, %rdi
leaq 0x20454(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0x86e49
movq 0x68(%rsp), %rax
subq 0x30(%rax), %r12
movq 0x50(%rsp), %rcx
subq 0x18(%rax), %rcx
imulq 0x28(%rax), %rcx
movq 0x48(%rsp), %rsi
subq (%rax), %rsi
imulq 0x10(%rax), %rsi
addq %r12, %rcx
addq %rcx, %rsi
movq %r13, %rdi
addq $0x10, %rdi
callq 0x21b0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x18fba
movq %rax, %rdi
leaq 0x3931a(%rip), %rsi     # 0xc0178
callq 0x4ace2
movq %rax, %rdi
leaq 0x203e9(%rip), %rsi     # 0xa7256
callq 0x18fba
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0x86e91
movq 0x70(%rsp), %rax
movq %r13, %rdi
addq $0x10, %rdi
movl (%rax), %esi
callq 0x22f0
movq %r13, %rdi
leaq 0x333fe(%rip), %rsi     # 0xba299
callq 0x18fba
movq %r14, %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x86ec4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x70(%rsp), %rax
incl (%rax)
leaq 0x60(%rsp), %rdi
callq 0x203cc
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
decq %rbx
jne 0x86d25
movq 0x38(%rsp), %rcx
incq %rcx
movq %rcx, 0x38(%rsp)
cmpq 0x40(%rsp), %rcx
jne 0x86cfe
movq 0x30(%rsp), %rdx
incq %rdx
movq 0x78(%rsp), %rax
movq %rdx, 0x30(%rsp)
cmpq %rax, %rdx
jne 0x86ccc
cmpl $0x78, 0xc(%rsp)
sete %r15b
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x37fd0(%rip), %rsi     # 0xbef07
leaq 0x37fe4(%rip), %rdx     # 0xbef22
leaq 0x10(%rsp), %rdi
callq 0xd14c
movzbl %r15b, %esi
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xbf80
leaq 0x1c71f(%rip), %rsi     # 0xa3684
leaq 0xc8(%rsp), %rdi
callq 0x18fba
leaq 0x391ff(%rip), %rsi     # 0xc0178
movq %rax, %rdi
callq 0x4ace2
leaq 0x202ce(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x86fac
movq %rbx, %rdi
addq $0x10, %rdi
movl 0xc(%rsp), %esi
callq 0x22f0
leaq 0x1c6d1(%rip), %rsi     # 0xa3684
movq %rbx, %rdi
callq 0x18fba
leaq 0x37f5d(%rip), %rsi     # 0xbef1f
movq %rax, %rdi
callq 0x19a02
leaq 0x20285(%rip), %rsi     # 0xa7256
movq %rax, %rdi
callq 0x18fba
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x86ff6
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x78, %esi
callq 0x22f0
leaq 0x3329c(%rip), %rsi     # 0xba299
movq %rbx, %rdi
callq 0x18fba
leaq 0xc8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x87029
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x87098
jmp 0x87047
movq %rax, %rbx
jmp 0x87057
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x8708b
jmp 0x87098
jmp 0x870a0
movq %rax, %rbx
jmp 0x8707c
jmp 0x8706c
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbfd8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x87098
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc0a9