// File: /workspace/github_cpp_makefile_star2_O3/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 0x4b8c
movl %edx, %r15d
testl %edx, %edx
jle 0x4b8c
testl %esi, %esi
jle 0x4b8c
testl %ecx, %ecx
jle 0x4b8c
movl 0x8(%rdi), %eax
cmpl %r15d, %eax
jl 0x4b01
movl 0xc(%rdi), %r10d
cmpl %ecx, %r10d
jl 0x4b01
cmpl %esi, %eax
jb 0x4b01
movl %r8d, %r12d
cmpl %r8d, %r10d
jl 0x4b01
cmpl %esi, %r15d
movq %r9, %r14
movq %rdi, %r13
jne 0x4a99
subl %ecx, %r12d
jb 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 0x3330
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
jb 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 0x3330
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 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7616(%rip), %rsi      # 0xc134
leaq 0x761e(%rip), %rdx      # 0xc143
leaq 0x28(%rsp), %rdi
callq 0x3c44
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x76d5(%rip), %rsi      # 0xc218
leaq 0x76fa(%rip), %rdx      # 0xc244
leaq 0x88(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xb220(%rip), %rsi      # 0xfd98
leaq -0xf65(%rip), %rdx      # 0x3c1a
movq %rbx, %rdi
callq 0x2180
jmp 0x4c91
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7634(%rip), %rsi      # 0xc1dd
leaq 0x7639(%rip), %rdx      # 0xc1e9
leaq 0x48(%rsp), %rdi
callq 0x3c44
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x761c(%rip), %rsi      # 0xc1ea
leaq 0x7642(%rip), %rdx      # 0xc217
leaq 0xa8(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x48(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xb195(%rip), %rsi      # 0xfd98
leaq -0xff0(%rip), %rdx      # 0x3c1a
movq %rbx, %rdi
callq 0x2180
jmp 0x4c91
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7503(%rip), %rsi      # 0xc134
leaq 0x750b(%rip), %rdx      # 0xc143
leaq 0x8(%rsp), %rdi
callq 0x3c44
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x773d(%rip), %rsi      # 0xc390
leaq 0x7790(%rip), %rdx      # 0xc3ea
leaq 0x68(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xb116(%rip), %rsi      # 0xfd98
leaq -0x106f(%rip), %rdx     # 0x3c1a
movq %rbx, %rdi
callq 0x2180
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ca3
callq 0x2100
movq 0x8(%rsp), %rdi
jmp 0x4cf6
movq %rax, %r14
movq 0x8(%rsp), %rdi
jmp 0x4d0f
jmp 0x4d1d
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ccb
callq 0x2100
movq 0x48(%rsp), %rdi
jmp 0x4cf6
movq %rax, %r14
movq 0x48(%rsp), %rdi
jmp 0x4d0f
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x4cf1
callq 0x2100
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4d00
callq 0x2100
testb %bpl, %bpl
jne 0x4d20
jmp 0x4d28
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4d20
callq 0x2100
jmp 0x4d20
jmp 0x4d1d
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x21b0