// File: /workspace/github_cpp_makefile_star2_O1/IlanPrice[P]Linear-Algebra-Library-in-Cplusplus/Matrix.cpp
// Function: Matrix::setElements(int, int, int, int, Vector)
void Matrix:: setElements(int istart, int iend, int jstart, int jend, Vector v)
{
	if (istart < 1 || jstart < 1 || iend < 1 || jend < 1)
		    {
		      throw Exception("out of range",
				  "accessing vector through () - index too small");
		    }
		  else if (iend > mRows || jend > mColumns || istart > mRows || jstart > mColumns)
		    {
		      throw Exception("length mismatch",
				  "accessing vector through () - index too high");
		    }

		if (iend==istart) // if user is setting part of a row to the specified vector
		{
			int sColumns = jend - jstart + 1;
			for (int j = 0; j<sColumns; j++)
			{
				mElements[istart -1][jstart -1 + j] = v(j+1);
			}

		}
		else if (jend == jstart) // if user is setting part of a column to the specified vector
		{
			int sRows = iend - istart + 1;
			for (int i = 0; i<sRows; i++)
			{
				mElements[istart -1 + i][jstart-1] = v(i+1);
			}

		}

		else
		{
			throw Exception("length mismatch",
							  "trying to assign a vector to a space of the form mxn where both m and n are greater than 1");
		}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
testl %r8d, %r8d
jle 0x4b83
movl %edx, %r15d
testl %edx, %edx
jle 0x4b83
testl %esi, %esi
jle 0x4b83
testl %ecx, %ecx
jle 0x4b83
movl 0x8(%rdi), %eax
cmpl %r15d, %eax
jl 0x4b01
movl 0xc(%rdi), %r10d
cmpl %ecx, %r10d
jl 0x4b01
cmpl %esi, %eax
jl 0x4b01
movl %r8d, %r12d
cmpl %r8d, %r10d
jl 0x4b01
cmpl %esi, %r15d
movq %r9, %r14
movq %rdi, %r13
jne 0x4a99
subl %ecx, %r12d
jl 0x4aef
movl %esi, %eax
movq %rax, (%rsp)
incl %r12d
movl %ecx, %eax
leaq -0x8(,%rax,8), %rbp
xorl %r15d, %r15d
leaq 0x1(%r15), %rbx
movq %r9, %rdi
movl %ebx, %esi
callq 0x3354
movq %r14, %r9
movsd (%rax), %xmm0
movq (%r13), %rax
movq (%rsp), %rcx
movq -0x8(%rax,%rcx,8), %rax
addq %rbp, %rax
movsd %xmm0, (%rax,%r15,8)
movq %rbx, %r15
cmpq %rbx, %r12
jne 0x4a64
jmp 0x4aef
cmpl %ecx, %r12d
jne 0x4c14
subl %esi, %r15d
jl 0x4aef
movl %ecx, %eax
movq %rax, (%rsp)
incl %r15d
movl %esi, %eax
leaq -0x8(,%rax,8), %rbp
xorl %ebx, %ebx
leaq 0x1(%rbx), %r12
movq %r9, %rdi
movl %r12d, %esi
callq 0x3354
movq %r14, %r9
movsd (%rax), %xmm0
movq (%r13), %rax
addq %rbp, %rax
movq (%rax,%rbx,8), %rax
movq (%rsp), %rcx
movsd %xmm0, -0x8(%rax,%rcx,8)
movq %r12, %rbx
cmpq %r12, %r15
jne 0x4abc
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7616(%rip), %rsi      # 0xc134
leaq 0x761e(%rip), %rdx      # 0xc143
leaq 0x68(%rsp), %rdi
callq 0x3c6e
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x76d8(%rip), %rsi      # 0xc218
leaq 0x76fd(%rip), %rdx      # 0xc244
leaq 0x48(%rsp), %rdi
callq 0x3c6e
movb $0x1, %bpl
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x3d00
xorl %ebp, %ebp
leaq 0xb229(%rip), %rsi      # 0xfd98
leaq -0xf32(%rip), %rdx      # 0x3c44
movq %rbx, %rdi
callq 0x2190
jmp 0x4c91
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x763a(%rip), %rsi      # 0xc1dd
leaq 0x763f(%rip), %rdx      # 0xc1e9
leaq 0xa8(%rsp), %rdi
callq 0x3c6e
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x761f(%rip), %rsi      # 0xc1ea
leaq 0x7645(%rip), %rdx      # 0xc217
leaq 0x88(%rsp), %rdi
callq 0x3c6e
movb $0x1, %bpl
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %rbx, %rdi
callq 0x3d00
xorl %ebp, %ebp
leaq 0xb195(%rip), %rsi      # 0xfd98
leaq -0xfc6(%rip), %rdx      # 0x3c44
movq %rbx, %rdi
callq 0x2190
jmp 0x4c91
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7503(%rip), %rsi      # 0xc134
leaq 0x750b(%rip), %rdx      # 0xc143
leaq 0x28(%rsp), %rdi
callq 0x3c6e
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x773d(%rip), %rsi      # 0xc390
leaq 0x7790(%rip), %rdx      # 0xc3ea
leaq 0x8(%rsp), %rdi
callq 0x3c6e
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3d00
xorl %ebp, %ebp
leaq 0xb116(%rip), %rsi      # 0xfd98
leaq -0x1045(%rip), %rdx     # 0x3c44
movq %rbx, %rdi
callq 0x2190
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4cab
callq 0x2110
jmp 0x4cab
movq %rax, %r14
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
jmp 0x4cfa
jmp 0x4d08
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x4cd1
callq 0x2110
jmp 0x4cd1
movq %rax, %r14
movb $0x1, %bpl
movq 0xa8(%rsp), %rdi
jmp 0x4cfa
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x4cf5
callq 0x2110
jmp 0x4cf5
movq %rax, %r14
movb $0x1, %bpl
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x4d0e
callq 0x2110
jmp 0x4d0e
jmp 0x4d08
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4d1b
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x21c0