// File: /workspace/github_cpp_makefile_star2_O2/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 $0x248, %rsp            # imm = 0x248
leaq 0x70(%rsp), %rbx
pushq $0x3
popq %rsi
pushq $0x5
popq %rdx
pushq $0x8
popq %rcx
movq %rbx, %rdi
callq 0x10810
movq %rbx, %rdi
callq 0x6e6d
leaq 0xc(%rsp), %rax
andl $0x0, (%rax)
leaq 0x28(%rsp), %rcx
movq %rbx, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
addq %rcx, %rax
movq %rax, 0x40(%rsp)
leaq 0xb8(%rsp), %rbp
leaq 0x1a772(%rip), %r15     # 0x8d647
cmpq 0x40(%rsp), %rcx
je 0x73055
movq 0x88(%rsp), %rdx
movq 0x90(%rsp), %rax
addq %rdx, %rax
movq %rax, 0x48(%rsp)
movq %rcx, 0x10(%rsp)
cmpq 0x48(%rsp), %rdx
je 0x7304d
movl 0xa0(%rsp), %esi
movq 0xa8(%rsp), %r12
movq %rdx, 0x18(%rsp)
subq $0x1, %r12
jb 0x73045
movq 0x30(%rsp), %rdi
movl %esi, 0x8(%rsp)
callq 0x1461a
movq %rax, %r13
movq 0x38(%rsp), %rax
movq %rbp, %rbx
movslq (%rax), %rbp
leaq 0x50(%rsp), %r14
movq %r14, %rdi
leaq 0x388f9(%rip), %rsi     # 0xab84a
leaq 0x7(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq %rbp, %r13
movq %rbx, %rbp
sete %sil
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6894
movq %rbp, %rdi
movq %r15, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x388e6(%rip), %rsi     # 0xab86d
callq 0x107d8
movq %rax, %rdi
leaq 0x1e65c(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %r13
movq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
callq 0x1461a
movq %rax, 0x20(%rsp)
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x107ba
movq %rax, %rdi
movq %r15, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x3890e(%rip), %rsi     # 0xab8eb
callq 0x3bfc6
movq %rax, %rdi
leaq 0x1e606(%rip), %rsi     # 0x915f2
callq 0x106fe
movq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
leaq 0x3229a(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %rbp, %rdi
callq 0x68d4
leaq 0x50(%rsp), %rdi
callq 0x2090
movq 0x38(%rsp), %rax
incl (%rax)
leaq 0x28(%rsp), %rdi
callq 0x172e2
movl 0x8(%rsp), %esi
incl %esi
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
jmp 0x72f1c
incq %rdx
jmp 0x72efd
incq %rcx
jmp 0x72ed5
movl 0xc(%rsp), %ebx
leaq 0x375d2(%rip), %rsi     # 0xaa632
leaq 0x50(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl $0x78, %ebx
sete %sil
leaq 0xb8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x6894
leaq 0x1a5b6(%rip), %rsi     # 0x8d647
leaq 0xb8(%rsp), %rdi
callq 0x106fe
leaq 0x38846(%rip), %rsi     # 0xab8eb
movq %rax, %rdi
callq 0x3bfc6
leaq 0x1e53e(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
leaq 0x1a577(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x3756b(%rip), %rsi     # 0xaa64a
movq %rax, %rdi
callq 0x1110a
leaq 0x1e504(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x28(%rsp), %rsi
movl $0x78, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x32192(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x50(%rsp), %rdi
callq 0x2090
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x7317f
jmp 0x7314a
jmp 0x7315e
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
jmp 0x73175
jmp 0x73187
movq %rax, %rbx
jmp 0x73175
jmp 0x73165
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x68d4
leaq 0x50(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba