// File: /workspace/github_cpp_makefile_star2_O1/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 %ebx, %ebx
leaq 0xc8(%rsp), %rsi
movq %rbx, (%rsi)
movl $0x3, %r14d
movq %r14, 0x8(%rsi)
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
movq %r15, 0x10(%rsi)
xorl %edi, %edi
callq 0xd09f
leaq 0x98(%rsp), %rsi
movq %rbx, -0x18(%rsi)
movq $0x8, -0x10(%rsi)
movq %r15, -0x8(%rsi)
movq %rbx, (%rsi)
movq $0x5, 0x8(%rsi)
movq %r15, 0x10(%rsi)
movq %rbx, 0x18(%rsi)
movq %r14, 0x20(%rsi)
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0xc4eb
leaq 0xc(%rsp), %rax
movl $0x0, (%rax)
movq %rbx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x84f12
movq 0x80(%rsp), %rcx
movq %rcx, 0x30(%rsp)
addq %rcx, 0x40(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0x84efa
movq 0x98(%rsp), %rcx
movq %rcx, 0x38(%rsp)
addq %rcx, 0x48(%rsp)
movslq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xb8(%rsp), %rbx
testq %rbx, %rbx
je 0x84ee2
movq 0xb0(%rsp), %r15
movslq 0x38(%rsp), %rax
movq %rax, 0x58(%rsp)
shlq $0x20, %r15
movq %r15, %r12
sarq $0x20, %r12
movq 0x70(%rsp), %rax
movq %r12, %rcx
subq 0x30(%rax), %rcx
movq 0x78(%rsp), %rdx
movq 0x58(%rsp), %rsi
subq 0x18(%rax), %rsi
imulq 0x28(%rax), %rsi
addq %rcx, %rsi
movq 0x50(%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, 0x60(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x397e2(%rip), %xmm0    # 0xbe577
movups %xmm0, (%rax)
movups 0x397e8(%rip), %xmm0    # 0xbe587
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 0xbf0a
leaq 0x1c87f(%rip), %rbp     # 0xa1654
movq %r14, %rdi
movq %rbp, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x397b0(%rip), %rsi     # 0xbe59a
callq 0x18abe
movq %rax, %rdi
leaq 0x20531(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0x84e40
movq 0x70(%rsp), %rax
subq 0x30(%rax), %r12
movq 0x58(%rsp), %rcx
subq 0x18(%rax), %rcx
imulq 0x28(%rax), %rcx
movq 0x50(%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 0x18a16
movq %rax, %rdi
leaq 0x397c3(%rip), %rsi     # 0xbe618
callq 0x4a210
movq %rax, %rdi
leaq 0x204c6(%rip), %rsi     # 0xa532a
callq 0x18a16
movq %rax, %r13
cmpb $0x1, 0x188(%rax)
jne 0x84e88
movq 0x78(%rsp), %rax
movq %r13, %rdi
addq $0x10, %rdi
movl (%rax), %esi
callq 0x22f0
movq %r13, %rdi
leaq 0x334d7(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r14, %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x84ebb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x78(%rsp), %rax
incl (%rax)
leaq 0x68(%rsp), %rdi
callq 0x1f92a
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
decq %rbx
jne 0x84d1c
movq 0x38(%rsp), %rcx
incq %rcx
movq %rcx, 0x38(%rsp)
cmpq 0x48(%rsp), %rcx
jne 0x84cf5
movq 0x30(%rsp), %rcx
incq %rcx
movq %rcx, 0x30(%rsp)
cmpq 0x40(%rsp), %rcx
jne 0x84cc3
movl 0xc(%rsp), %ebx
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x38481(%rip), %rsi     # 0xbd3a7
leaq 0x38495(%rip), %rdx     # 0xbd3c2
leaq 0x10(%rsp), %rdi
callq 0xd0b8
xorl %esi, %esi
cmpl $0x78, %ebx
sete %sil
leaq 0xc8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xbf0a
leaq 0x1c6fb(%rip), %rsi     # 0xa1654
leaq 0xc8(%rsp), %rdi
callq 0x18a16
leaq 0x396ab(%rip), %rsi     # 0xbe618
movq %rax, %rdi
callq 0x4a210
leaq 0x203ae(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x84fa0
movq %rbx, %rdi
addq $0x10, %rdi
movl 0xc(%rsp), %esi
callq 0x22f0
leaq 0x1c6ad(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x38409(%rip), %rsi     # 0xbd3bf
movq %rax, %rdi
callq 0x19436
leaq 0x20365(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x84fea
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x78, %esi
callq 0x22f0
leaq 0x33378(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0xc8(%rsp), %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x8501d
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 0x8508c
jmp 0x8503b
movq %rax, %rbx
jmp 0x8504b
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0x8507f
jmp 0x8508c
jmp 0x85094
movq %rax, %rbx
jmp 0x85070
jmp 0x85060
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbf62
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8508c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc036