// File: /workspace/github_cpp_makefile_star2_O2/schaefed[P]Ndarray/test/test_ndarray.cpp
// Function: testIterator()
void testIterator(){
	array<size_t, 2> shape = {4, 4};
	vector<int64_t> basevec  = range(product<size_t>(shape));
	auto array = ndarray<int64_t, 2>(basevec.data(), shape);
	Ndarray<int64_t,2> test;

	auto tester = [](auto array, vector<int64_t> check){
		int64_t i = 0;
		for (auto e: array){
			assert (e == check[i++]); // Wrong iteration element
		}
	};

	tester(array, range(16));
	tester(array[3], range(12, 16));
	tester(array[Slice<>(0, 2)], range(8));
	tester(array[Slice<>(0, 4, 2)],
		   concat<int64_t>({range(4), range(8, 12)})
		   );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x2d0, %rsp            # imm = 0x2D0
leaq 0x128(%rsp), %rbx
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x231c
leaq 0x1c8(%rsp), %r8
andq $0x0, 0x8(%r8)
movq (%rbx), %rsi
leaq 0x836(%rip), %rax       # 0x41af
movq %rax, (%r8)
leaq 0x1753(%rip), %rax      # 0x50d6
movq %rax, 0x18(%r8)
leaq 0x1750(%rip), %rax      # 0x50de
movq %rax, 0x10(%r8)
leaq 0x140(%rsp), %rdi
pushq $0x4
popq %rcx
movq %rcx, %rdx
callq 0x410d
leaq 0x1c8(%rsp), %rdi
callq 0x41b0
xorps %xmm0, %xmm0
movaps %xmm0, 0x1b0(%rsp)
movaps %xmm0, 0x1a0(%rsp)
movaps %xmm0, 0x190(%rsp)
movaps %xmm0, 0x180(%rsp)
leaq 0x268(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x4b74
leaq 0xe0(%rsp), %rdi
pushq $0x10
popq %rsi
callq 0x231c
leaq 0x268(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x3d8a
leaq 0xe0(%rsp), %rdi
callq 0x4c0c
leaq 0x280(%rsp), %rdi
callq 0x4adc
leaq 0xf8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
pushq $0x3
popq %rdx
callq 0x41cc
leaq 0xc8(%rsp), %rdi
pushq $0xc
popq %rsi
pushq $0x10
popq %rdx
pushq $0x1
popq %rcx
callq 0x2355
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %r14
movq %r14, 0x28(%rsp)
movq %r14, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
leaq 0x120(%rsp), %rcx
movq %rax, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
leaq 0x2a8(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x44c0
xorl %r15d, %r15d
leaq 0x28(%rsp), %rbx
cmpq 0x2b0(%rsp), %r14
je 0x3ad4
movq (%r14), %rax
movq 0xc8(%rsp), %rcx
cmpq (%rcx,%r15), %rax
jne 0x3c77
movq %rbx, %rdi
callq 0x56b8
movq 0x30(%rsp), %r14
addq $0x8, %r15
jmp 0x3aa2
leaq 0xc8(%rsp), %rdi
callq 0x4c0c
leaq 0x110(%rsp), %rdi
callq 0x4adc
andq $0x0, 0x78(%rsp)
movq $0x2, 0x80(%rsp)
movq $0x1, 0x88(%rsp)
andq $0x0, 0x90(%rsp)
movups 0x78(%rsp), %xmm0
movups 0x88(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x228(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x477e
leaq 0xb0(%rsp), %rdi
pushq $0x8
popq %rsi
callq 0x231c
leaq 0x228(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x3d8a
leaq 0xb0(%rsp), %rdi
callq 0x4c0c
leaq 0x240(%rsp), %rdi
callq 0x4adc
andq $0x0, 0x58(%rsp)
movq $0x4, 0x60(%rsp)
movq $0x2, 0x68(%rsp)
andq $0x0, 0x70(%rsp)
movups 0x58(%rsp), %xmm0
movups 0x68(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x477e
leaq 0x28(%rsp), %rdi
pushq $0x4
popq %rsi
callq 0x231c
leaq 0x40(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0xc
popq %rdx
pushq $0x1
popq %rcx
callq 0x2355
leaq 0x98(%rsp), %rdi
leaq 0x28(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x48b2
leaq 0x1e8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x3d8a
leaq 0x98(%rsp), %rdi
callq 0x4c0c
pushq $0x18
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x28, %rdi
callq 0x4c0c
addq $-0x18, %rbx
cmpq $-0x18, %rbx
jne 0x3c1f
leaq 0x200(%rsp), %rdi
callq 0x4adc
leaq 0x198(%rsp), %rdi
callq 0x4adc
leaq 0x158(%rsp), %rdi
callq 0x4adc
leaq 0x128(%rsp), %rdi
callq 0x4c0c
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2830(%rip), %rdi      # 0x64ae
leaq 0x23c3(%rip), %rsi      # 0x6048
leaq 0x28a2(%rip), %rcx      # 0x652e
pushq $0x7c
popq %rdx
callq 0x20c0
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4c0c
jmp 0x3ca9
movq %rax, %rbx
pushq $0x18
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x28, %rdi
callq 0x4c0c
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x3cad
jmp 0x3cd8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4c0c
jmp 0x3cd8
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
jmp 0x3d56
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x4c0c
jmp 0x3cf7
movq %rax, %rbx
leaq 0x240(%rsp), %rdi
jmp 0x3d56
jmp 0x3d3e
movq %rax, %rbx
jmp 0x3d4e
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x4c0c
jmp 0x3d1d
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
jmp 0x3d56
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x41b0
jmp 0x3d75
movq %rax, %rbx
jmp 0x3d5b
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x4c0c
leaq 0x110(%rsp), %rdi
callq 0x4adc
leaq 0x198(%rsp), %rdi
callq 0x4adc
leaq 0x158(%rsp), %rdi
callq 0x4adc
leaq 0x128(%rsp), %rdi
callq 0x4c0c
movq %rbx, %rdi
callq 0x21c0