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

	array1d[0] = 3;
	assert(array1d[0] == 3); // single value assignment failed!

	array2d[eee] = 21;
	for (auto e: array2d){
		assert(e == 21); // broadcast assignment failed!
	}

	array2d[Slice<1>(0,-1,2)][eee] = 42;
	bool tmp = true;
	for (auto e: array1d){
		assert ( e = (tmp) ? 42 : 21); // broadcast assignment failed
		tmp = not tmp;
	}

	array2d[__] = array1d;
	for (size_t i=0; i < array2d.shape[0] ; i++){
		assert (array2d[i][0] == array1d[0]); // broadcast assignment failed
		assert (array2d[i][8] == array1d[8]); // broadcast assignment failed
		assert (array2d[i][15] == array1d[15]); // broadcast assignment failed
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
leaq 0x140(%rsp), %rbx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
callq 0x231c
leaq 0x158(%rsp), %r8
andq $0x0, 0x8(%r8)
movq (%rbx), %rsi
leaq 0x1dc0(%rip), %rax      # 0x41af
movq %rax, (%r8)
leaq 0x2cdd(%rip), %rax      # 0x50d6
movq %rax, 0x18(%r8)
leaq 0x2cda(%rip), %rax      # 0x50de
movq %rax, 0x10(%r8)
leaq 0x70(%rsp), %rdi
pushq $0x10
popq %rcx
movq %rcx, %rdx
callq 0x410d
leaq 0x158(%rsp), %rdi
callq 0x41b0
leaq 0xb0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
xorl %edx, %edx
callq 0x41cc
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
callq 0x4266
movq $0x3, (%rax)
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
callq 0x4266
cmpq $0x3, (%rax)
jne 0x27a6
leaq 0x100(%rsp), %rbx
movq $0x15, (%rbx)
leaq 0x28(%rsp), %r14
leaq 0x70(%rsp), %rsi
movq %r14, %rdi
callq 0x4b74
movq %r14, %rdi
movq %rbx, %rsi
callq 0x429e
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4adc
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rcx
movq %rcx, -0x18(%rbx)
movq %rcx, -0x10(%rbx)
andq $0x0, -0x8(%rbx)
leaq 0xa0(%rsp), %rcx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
leaq 0x100(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x431e
leaq 0x28(%rsp), %rbx
movq 0x30(%rsp), %rax
cmpq 0x108(%rsp), %rax
je 0x2503
cmpq $0x15, (%rax)
jne 0x273e
movq %rbx, %rdi
callq 0x55d8
jmp 0x24e0
andq $0x0, 0xe0(%rsp)
orq $-0x1, 0xe8(%rsp)
movq $0x2a, 0x68(%rsp)
movq $0x2, 0xf0(%rsp)
movq $0x1, 0xf8(%rsp)
movups 0xe0(%rsp), %xmm0
movups 0xf0(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x100(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x438a
leaq 0x28(%rsp), %rbx
leaq 0x100(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b74
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x429e
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x4adc
leaq 0x118(%rsp), %rdi
callq 0x4adc
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rcx
movq %rcx, -0x18(%rbx)
movq %rcx, -0x10(%rbx)
andq $0x0, -0x8(%rbx)
leaq 0xd8(%rsp), %rcx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
leaq 0x100(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x44c0
leaq 0x28(%rsp), %rbx
movq 0x30(%rsp), %rax
cmpq 0x108(%rsp), %rax
je 0x25f8
movq %rbx, %rdi
callq 0x56b8
jmp 0x25df
leaq 0x28(%rsp), %rbx
leaq 0x70(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b74
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x452c
leaq 0x40(%rsp), %rdi
callq 0x4adc
xorl %r12d, %r12d
leaq 0x28(%rsp), %r13
leaq 0xb0(%rsp), %rbx
pushq $0x8
popq %r15
pushq $0xf
popq %rbp
cmpq 0x90(%rsp), %r12
jae 0x2705
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
movq %r12, %rdx
callq 0x41cc
movq %r13, %rdi
xorl %esi, %esi
callq 0x4266
movq (%rax), %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4266
cmpq (%rax), %r14
jne 0x2789
leaq 0x40(%rsp), %rdi
callq 0x4adc
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
movq %r12, %rdx
callq 0x41cc
movq %r15, %r14
movq %r13, %rdi
movq %r15, %rsi
callq 0x4266
movq %r14, %rsi
movq (%rax), %r14
movq %rbx, %rdi
callq 0x4266
cmpq (%rax), %r14
jne 0x2757
leaq 0x40(%rsp), %rdi
callq 0x4adc
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
movq %r12, %rdx
callq 0x41cc
movq %rbp, %r14
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4266
movq %r14, %rsi
movq (%rax), %r14
movq %rbx, %rdi
callq 0x4266
cmpq (%rax), %r14
jne 0x2770
leaq 0x40(%rsp), %rdi
callq 0x4adc
incq %r12
jmp 0x263b
leaq 0xc8(%rsp), %rdi
callq 0x4adc
leaq 0x88(%rsp), %rdi
callq 0x4adc
leaq 0x140(%rsp), %rdi
callq 0x4c0c
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x392f(%rip), %rdi      # 0x6074
leaq 0x38fc(%rip), %rsi      # 0x6048
leaq 0x390b(%rip), %rcx      # 0x605e
pushq $0x16
jmp 0x27a0
leaq 0x393a(%rip), %rdi      # 0x6098
leaq 0x38e3(%rip), %rsi      # 0x6048
leaq 0x38f2(%rip), %rcx      # 0x605e
pushq $0x23
jmp 0x27a0
leaq 0x393d(%rip), %rdi      # 0x60b4
leaq 0x38ca(%rip), %rsi      # 0x6048
leaq 0x38d9(%rip), %rcx      # 0x605e
pushq $0x24
jmp 0x27a0
leaq 0x38ec(%rip), %rdi      # 0x607c
leaq 0x38b1(%rip), %rsi      # 0x6048
leaq 0x38c0(%rip), %rcx      # 0x605e
pushq $0x22
popq %rdx
callq 0x20c0
leaq 0x388b(%rip), %rdi      # 0x6038
leaq 0x3894(%rip), %rsi      # 0x6048
leaq 0x38a3(%rip), %rcx      # 0x605e
pushq $0x12
jmp 0x27a0
jmp 0x280a
jmp 0x2801
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4adc
leaq 0x118(%rsp), %rdi
jmp 0x2812
jmp 0x2801
jmp 0x2801
jmp 0x280a
movq %rax, %rbx
jmp 0x2824
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x41b0
jmp 0x2831
jmp 0x2801
jmp 0x2801
jmp 0x2801
jmp 0x2801
jmp 0x2801
movq %rax, %rbx
jmp 0x2817
jmp 0x280a
jmp 0x280a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x4adc
leaq 0xc8(%rsp), %rdi
callq 0x4adc
leaq 0x88(%rsp), %rdi
callq 0x4adc
leaq 0x140(%rsp), %rdi
callq 0x4c0c
movq %rbx, %rdi
callq 0x21c0