// File: /workspace/github_cpp_makefile_star2_O2/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 $0x268, %rsp            # imm = 0x268
leaq 0x90(%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 0x10(%rsp), %rcx
movq %rbx, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
addq %rax, %rcx
movq %rcx, 0x28(%rsp)
leaq 0xd8(%rsp), %r14
leaq 0x19734(%rip), %r12     # 0x8d647
cmpq 0x28(%rsp), %rax
je 0x740a2
movq 0xa8(%rsp), %rcx
movq 0xb0(%rsp), %rdx
addq %rcx, %rdx
movq %rdx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
cmpq 0x30(%rsp), %rcx
je 0x7409a
movq 0xc0(%rsp), %rdx
movq 0xc8(%rsp), %r13
movq %rcx, 0x40(%rsp)
subq $0x1, %r13
jb 0x74092
movq %rax, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
movq %rdx, 0x48(%rsp)
movq %rdx, 0x60(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x16379
movq %rax, %r15
movq 0x20(%rsp), %rax
movq %r14, %rbx
movslq (%rax), %r14
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
leaq 0x37901(%rip), %rsi     # 0xab8a6
leaq 0xb(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq %r14, %r15
movq %rbx, %r14
sete %sil
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x6894
movq %r14, %rdi
movq %r12, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x36f83(%rip), %rsi     # 0xaaf5e
callq 0x1071a
movq %rax, %rdi
leaq 0x1d608(%rip), %rsi     # 0x915f2
callq 0x106fe
movq %rax, %r15
movq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x16379
movq %rax, 0x68(%rsp)
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x107ba
movq %rax, %rdi
movq %r12, %rsi
callq 0x106fe
movq %rax, %rdi
leaq 0x378c3(%rip), %rsi     # 0xab8eb
callq 0x3bfc6
movq %rax, %rdi
leaq 0x1d5bb(%rip), %rsi     # 0x915f2
callq 0x106fe
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
movq %rax, %rdi
leaq 0x3124f(%rip), %rsi     # 0xa52a2
callq 0x106fe
movq %r14, %rdi
callq 0x68d4
leaq 0x70(%rsp), %rdi
callq 0x2090
movq 0x20(%rsp), %rax
incl (%rax)
leaq 0x10(%rsp), %rdi
callq 0x172e2
movq 0x48(%rsp), %rdx
incq %rdx
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
jmp 0x73f5b
incq %rcx
jmp 0x73f3b
incq %rax
jmp 0x73f13
movl 0xc(%rsp), %ebx
leaq 0x36585(%rip), %rsi     # 0xaa632
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpl $0x78, %ebx
sete %sil
leaq 0xd8(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x6894
leaq 0x19569(%rip), %rsi     # 0x8d647
leaq 0xd8(%rsp), %rdi
callq 0x106fe
leaq 0x377f9(%rip), %rsi     # 0xab8eb
movq %rax, %rdi
callq 0x3bfc6
leaq 0x1d4f1(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x10736
leaq 0x1952a(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x3651e(%rip), %rsi     # 0xaa64a
movq %rax, %rdi
callq 0x1110a
leaq 0x1d4b7(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x50(%rsp), %rsi
movl $0x78, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x31145(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0xd8(%rsp), %rdi
callq 0x68d4
leaq 0x70(%rsp), %rdi
callq 0x2090
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x741cc
jmp 0x74197
jmp 0x741ab
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x68d4
jmp 0x741c2
jmp 0x741d4
movq %rax, %rbx
jmp 0x741c2
jmp 0x741b2
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x68d4
leaq 0x70(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba