// File: /workspace/github_cpp_makefile_star2_O1/dsharlet[P]array/test/shape.cpp
// Function: nda::test_for_each_index_1d_body()
TEST(for_each_index_1d) {
  dense_shape<1> s(20);
  int expected_flat_offset = 0;
  for_each_index(s, [&](auto i) {
    ASSERT_EQ(s[i], expected_flat_offset);
    expected_flat_offset++;
  });
  // Ensure the for_each_index loop above actually ran.
  ASSERT_EQ(expected_flat_offset, 20);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
leaq 0x28(%rsp), %rbx
movq $0x0, (%rbx)
movq $0x14, 0x8(%rbx)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
xorl %edi, %edi
movq %rbx, %rsi
callq 0xd09f
movq %rsp, %r15
leaq 0x1bb12(%rip), %r13     # 0xa1654
leaq 0x1f7e1(%rip), %r12     # 0xa532a
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x1c, 0x20(%rsp)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, (%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x38a60(%rip), %xmm0    # 0xbe5df
movups %xmm0, 0xc(%rax)
movups 0x38a49(%rip), %xmm0    # 0xbe5d3
movups %xmm0, (%rax)
movq %rcx, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, (%rax,%rcx)
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0xbf0a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x380cc(%rip), %rsi     # 0xbdc8b
callq 0x18a4e
movq %rax, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x85bea
movq %rbp, %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x21b0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x38a19(%rip), %rsi     # 0xbe618
callq 0x4a210
movq %rax, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x85c2a
movq %rbp, %rdi
addq $0x10, %rdi
movl %r14d, %esi
callq 0x22f0
movq %rbp, %rdi
leaq 0x32735(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %rbx, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x85c5c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
incq %r14
cmpq $0x14, %r14
jne 0x85b49
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x376d0(%rip), %rsi     # 0xbd34b
leaq 0x376e3(%rip), %rdx     # 0xbd365
callq 0xd0b8
leaq 0x28(%rsp), %rdi
movq %rsp, %rdx
movl $0x1, %esi
callq 0xbf0a
leaq 0x1b9b4(%rip), %rsi     # 0xa1654
leaq 0x28(%rsp), %rdi
callq 0x18a16
leaq 0x38967(%rip), %rsi     # 0xbe618
movq %rax, %rdi
callq 0x4a210
leaq 0x1f66a(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x85ce5
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x1b968(%rip), %rsi     # 0xa1654
movq %rbx, %rdi
callq 0x18a16
leaq 0x1d530(%rip), %rsi     # 0xa322b
movq %rax, %rdi
callq 0x18bd6
leaq 0x1f620(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x85d2f
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x14, %esi
callq 0x22f0
leaq 0x32633(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0x28(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x85d63
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x85dbe
jmp 0x85d7e
jmp 0x85d8f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbf62
jmp 0x85da3
jmp 0x85dc6
movq %rax, %rbx
jmp 0x85da3
jmp 0x85d96
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x85dbe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc036