// File: 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:
subq $0x188, %rsp            # imm = 0x188
movq %r9, 0x48(%rsp)
movq %rdi, 0x180(%rsp)
movl %esi, 0x17c(%rsp)
movl %edx, 0x178(%rsp)
movl %ecx, 0x174(%rsp)
movl %r8d, 0x170(%rsp)
movq %r9, 0x168(%rsp)
movq 0x180(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpl $0x1, 0x17c(%rsp)
jl 0x63b2
cmpl $0x1, 0x174(%rsp)
jl 0x63b2
cmpl $0x1, 0x178(%rsp)
jl 0x63b2
cmpl $0x1, 0x170(%rsp)
jge 0x64f3
movb $0x1, 0x10e(%rsp)
movl $0x40, %edi
callq 0x2070
movq %rax, 0x38(%rsp)
leaq 0x147(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x21c0
movq 0x40(%rsp), %rdx
leaq 0xbdd6(%rip), %rsi      # 0x121bd
leaq 0x148(%rsp), %rdi
callq 0x2110
jmp 0x63f6
leaq 0x10f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x21c0
movq 0x30(%rsp), %rdx
leaq 0xbdb6(%rip), %rsi      # 0x121ca
leaq 0x110(%rsp), %rdi
callq 0x2110
jmp 0x6423
movq 0x38(%rsp), %rdi
leaq 0x148(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x4d60
jmp 0x643f
movq 0x38(%rsp), %rdi
movb $0x0, 0x10e(%rsp)
leaq 0xf94d(%rip), %rsi      # 0x15da0
leaq -0x172a(%rip), %rdx     # 0x4d30
callq 0x2180
jmp 0x6911
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x64cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x64b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x2080
leaq 0x10f(%rsp), %rdi
callq 0x20f0
leaq 0x148(%rsp), %rdi
callq 0x2080
leaq 0x147(%rsp), %rdi
callq 0x20f0
testb $0x1, 0x10e(%rsp)
jne 0x64e4
jmp 0x64ee
movq 0x38(%rsp), %rdi
callq 0x20a0
jmp 0x6904
movq 0x50(%rsp), %rcx
movl 0x178(%rsp), %eax
cmpl 0x8(%rcx), %eax
jg 0x653b
movq 0x50(%rsp), %rcx
movl 0x170(%rsp), %eax
cmpl 0xc(%rcx), %eax
jg 0x653b
movq 0x50(%rsp), %rcx
movl 0x17c(%rsp), %eax
cmpl 0x8(%rcx), %eax
jg 0x653b
movq 0x50(%rsp), %rcx
movl 0x174(%rsp), %eax
cmpl 0xc(%rcx), %eax
jle 0x667c
movb $0x1, 0xbe(%rsp)
movl $0x40, %edi
callq 0x2070
movq %rax, 0x20(%rsp)
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x21c0
movq 0x28(%rsp), %rdx
leaq 0xbba4(%rip), %rsi      # 0x12114
leaq 0xe8(%rsp), %rdi
callq 0x2110
jmp 0x657f
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x21c0
movq 0x18(%rsp), %rdx
leaq 0xbc5b(%rip), %rsi      # 0x121f8
leaq 0xc0(%rsp), %rdi
callq 0x2110
jmp 0x65ac
movq 0x20(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x4d60
jmp 0x65c8
movq 0x20(%rsp), %rdi
movb $0x0, 0xbe(%rsp)
leaq 0xf7c4(%rip), %rsi      # 0x15da0
leaq -0x18b3(%rip), %rdx     # 0x4d30
callq 0x2180
jmp 0x6911
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x6654
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x663a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x2080
leaq 0xbf(%rsp), %rdi
callq 0x20f0
leaq 0xe8(%rsp), %rdi
callq 0x2080
leaq 0xe7(%rsp), %rdi
callq 0x20f0
testb $0x1, 0xbe(%rsp)
jne 0x666d
jmp 0x6677
movq 0x20(%rsp), %rdi
callq 0x20a0
jmp 0x6904
jmp 0x667e
movl 0x178(%rsp), %eax
cmpl 0x17c(%rsp), %eax
jne 0x672a
movl 0x170(%rsp), %eax
subl 0x174(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb8(%rsp)
movl $0x0, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
cmpl 0xb8(%rsp), %eax
jge 0x6725
movq 0x48(%rsp), %rdi
movl 0xb4(%rsp), %esi
addl $0x1, %esi
callq 0x3ee0
movq %rax, %rcx
movq 0x50(%rsp), %rax
movsd (%rcx), %xmm0
movq (%rax), %rax
movl 0x17c(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl 0x174(%rsp), %ecx
subl $0x1, %ecx
addl 0xb4(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x66b5
jmp 0x68fc
movl 0x170(%rsp), %eax
cmpl 0x174(%rsp), %eax
jne 0x67d6
movl 0x178(%rsp), %eax
subl 0x17c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rsp)
movl $0x0, 0xac(%rsp)
movl 0xac(%rsp), %eax
cmpl 0xb0(%rsp), %eax
jge 0x67d1
movq 0x48(%rsp), %rdi
movl 0xac(%rsp), %esi
addl $0x1, %esi
callq 0x3ee0
movq %rax, %rcx
movq 0x50(%rsp), %rax
movsd (%rcx), %xmm0
movq (%rax), %rax
movl 0x17c(%rsp), %ecx
subl $0x1, %ecx
addl 0xac(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl 0x174(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x6761
jmp 0x68fa
movb $0x1, 0x5e(%rsp)
movl $0x40, %edi
callq 0x2070
movq %rax, 0x8(%rsp)
leaq 0x87(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x21c0
movq 0x10(%rsp), %rdx
leaq 0xb90c(%rip), %rsi      # 0x12114
leaq 0x88(%rsp), %rdi
callq 0x2110
jmp 0x6817
leaq 0x5f(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x21c0
movq (%rsp), %rdx
leaq 0xbb28(%rip), %rsi      # 0x12358
leaq 0x60(%rsp), %rdi
callq 0x2110
jmp 0x683c
movq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x4d60
jmp 0x6855
movq 0x8(%rsp), %rdi
movb $0x0, 0x5e(%rsp)
leaq 0xf53a(%rip), %rsi      # 0x15da0
leaq -0x1b3d(%rip), %rdx     # 0x4d30
callq 0x2180
jmp 0x6911
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x68d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x68c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x2080
leaq 0x5f(%rsp), %rdi
callq 0x20f0
leaq 0x88(%rsp), %rdi
callq 0x2080
leaq 0x87(%rsp), %rdi
callq 0x20f0
testb $0x1, 0x5e(%rsp)
jne 0x68ee
jmp 0x68f8
movq 0x8(%rsp), %rdi
callq 0x20a0
jmp 0x6904
jmp 0x68fc
addq $0x188, %rsp            # imm = 0x188
retq
movq 0x138(%rsp), %rdi
callq 0x21b0
nopw %cs:(%rax,%rax)