// File: /workspace/github_cpp_makefile_star2_O1/dsharlet[P]array/test/shape.cpp
// Function: nda::test_for_all_indices_2d_body()
TEST(for_all_indices_2d) {
  dense_shape<2> s(10, 4);
  s.resolve();
  int expected_flat_offset = 0;
  for_all_indices(s, [&](int x, int y) {
    ASSERT_EQ(s(x, y), expected_flat_offset);
    expected_flat_offset++;
  });
  // Ensure the for_all_indices loop above actually ran.
  ASSERT_EQ(expected_flat_offset, 40);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
xorl %ebx, %ebx
leaq 0x88(%rsp), %rsi
movq %rbx, (%rsi)
movl $0xa, %r15d
movq %r15, 0x8(%rsi)
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
movq %r12, 0x10(%rsi)
xorl %edi, %edi
callq 0xd09f
leaq 0x58(%rsp), %r14
movq %rbx, (%r14)
movq $0x4, 0x8(%r14)
movq %r12, 0x10(%r14)
movq %rbx, 0x18(%r14)
movq %r15, 0x20(%r14)
movl $0x4, %edi
movq %r14, %rsi
callq 0x1c2a0
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x84a8e
movq 0x58(%rsp), %rax
addq %rax, 0x20(%rsp)
xorl %ebx, %ebx
leaq 0x88(%rsp), %r15
leaq 0x1cd93(%rip), %r12     # 0xa1654
movq 0x78(%rsp), %rcx
testq %rcx, %rcx
je 0x84a80
movq 0x70(%rsp), %r13
movq %rax, 0x40(%rsp)
cltq
movq %rax, 0x28(%rsp)
movslq %ebx, %rbx
shlq $0x20, %r13
movq %rcx, 0x50(%rsp)
movq %r13, 0x48(%rsp)
sarq $0x20, %r13
movq %r13, %rax
subq 0x70(%rsp), %rax
movq 0x28(%rsp), %rbp
subq 0x58(%rsp), %rbp
imulq 0x68(%rsp), %rbp
addq %rax, %rbp
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x1f, 0x38(%rsp)
movq %r15, %r14
movq %rsp, %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x2310
movq %rax, (%rsp)
movq 0x38(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x39c12(%rip), %xmm0    # 0xbe55e
movups %xmm0, 0xf(%rax)
movups 0x39bf8(%rip), %xmm0    # 0xbe54f
movups %xmm0, (%rax)
movq %rcx, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, (%rax,%rcx)
xorl %esi, %esi
movq %rbx, 0x30(%rsp)
cmpq %rbp, %rbx
sete %sil
movq %r14, %rdi
movq %r15, %rdx
movq %r14, %r15
leaq 0x209a5(%rip), %rbx     # 0xa532a
callq 0xbf0a
movq %r15, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x39bd0(%rip), %rsi     # 0xbe56f
callq 0x18af6
movq %rax, %rdi
movq %rbx, %rsi
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x849df
subq 0x70(%rsp), %r13
movq 0x28(%rsp), %rsi
subq 0x58(%rsp), %rsi
imulq 0x68(%rsp), %rsi
addq %r13, %rsi
movq %rbp, %rdi
addq $0x10, %rdi
callq 0x21b0
movq %rbp, %rdi
movq %r12, %rsi
callq 0x18a16
movq %rax, %rdi
leaq 0x39c24(%rip), %rsi     # 0xbe618
callq 0x4a210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x18a16
movq %rax, %rbp
cmpb $0x1, 0x188(%rax)
jne 0x84a21
movq %rbp, %rdi
addq $0x10, %rdi
movq 0x30(%rsp), %rsi
callq 0x22f0
movq %rbp, %rdi
leaq 0x3393e(%rip), %rsi     # 0xb8369
callq 0x18a16
movq %r15, %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x84a53
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x30(%rsp), %rbx
incq %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
movq 0x48(%rsp), %r13
addq %rax, %r13
movq 0x50(%rsp), %rcx
decq %rcx
jne 0x848e7
movq 0x40(%rsp), %rax
incq %rax
cmpq 0x20(%rsp), %rax
jne 0x848c1
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x388db(%rip), %rsi     # 0xbd379
leaq 0x388ee(%rip), %rdx     # 0xbd393
movq %rsp, %rdi
callq 0xd0b8
xorl %esi, %esi
cmpl $0x28, %ebx
sete %sil
leaq 0x88(%rsp), %rdi
movq %rsp, %rdx
callq 0xbf0a
leaq 0x1cb87(%rip), %rsi     # 0xa1654
leaq 0x88(%rsp), %rdi
callq 0x18a16
leaq 0x39b37(%rip), %rsi     # 0xbe618
movq %rax, %rdi
callq 0x4a210
leaq 0x2083a(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %r14
cmpb $0x1, 0x188(%rax)
jne 0x84b12
movq %r14, %rdi
addq $0x10, %rdi
movl %ebx, %esi
callq 0x22f0
leaq 0x1cb3b(%rip), %rsi     # 0xa1654
movq %r14, %rdi
callq 0x18a16
leaq 0x2d330(%rip), %rsi     # 0xb1e58
movq %rax, %rdi
callq 0x18bd6
leaq 0x207f3(%rip), %rsi     # 0xa532a
movq %rax, %rdi
callq 0x18a16
movq %rax, %rbx
cmpb $0x1, 0x188(%rax)
jne 0x84b5c
movq %rbx, %rdi
addq $0x10, %rdi
movl $0x28, %esi
callq 0x22f0
leaq 0x33806(%rip), %rsi     # 0xb8369
movq %rbx, %rdi
callq 0x18a16
leaq 0x88(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x84b8e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x84bfb
jmp 0x84bac
movq %rax, %rbx
jmp 0x84bbc
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x84bee
jmp 0x84bfb
jmp 0x84c03
movq %rax, %rbx
jmp 0x84be0
jmp 0x84bd0
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbf62
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x84bfb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0xc036