// File: /workspace/github_cpp_makefile_star2_O1/IlanPrice[P]Linear-Algebra-Library-in-Cplusplus/Matrix.cpp
// Function: Matrix::getElements(int, int, int, int)
Matrix Matrix:: getElements(int istart, int iend, int jstart, int jend)
{
	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");
	    }

	int sRows = iend - istart + 1; int sColumns = jend - jstart + 1;
	Matrix slice(sRows, sColumns);
	for (int i = 0; i<sRows; i++)
	{
		for (int j = 0; j<sColumns; j++)
		{
			slice.mElements[i][j] = mElements[istart -1 + i][jstart -1 + j];
		}
	}
	return slice;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
testl %r9d, %r9d
jle 0x42d4
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x42d4
movl %edx, %r15d
testl %edx, %edx
jle 0x42d4
testl %r8d, %r8d
jle 0x42d4
movl 0x8(%rsi), %eax
cmpl %r14d, %eax
jl 0x4252
movl 0xc(%rsi), %ecx
cmpl %r8d, %ecx
jl 0x4252
cmpl %r15d, %eax
jl 0x4252
movl %r9d, %ebx
cmpl %r9d, %ecx
jl 0x4252
movq %rsi, 0x10(%rsp)
subl %r15d, %r14d
leal 0x1(%r14), %r12d
subl %r8d, %ebx
leal 0x1(%rbx), %r13d
movl %r12d, %esi
movl %r13d, %edx
movq %rdi, %rbp
movl %r8d, 0xc(%rsp)
callq 0x3df8
testl %r14d, %r14d
js 0x423d
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movq (%rbp), %r10
movl %r15d, %edx
leaq (%rcx,%rdx,8), %rcx
addq $-0x8, %rcx
movl 0xc(%rsp), %edx
xorl %esi, %esi
testl %ebx, %ebx
js 0x4235
movq (%rcx,%rsi,8), %r8
movq (%r10,%rsi,8), %rdi
leaq (%r8,%rdx,8), %r8
addq $-0x8, %r8
xorl %r9d, %r9d
movsd (%r8,%r9,8), %xmm0
movsd %xmm0, (%rdi,%r9,8)
incq %r9
cmpq %r9, %r13
jne 0x4221
incq %rsi
cmpq %r12, %rsi
jne 0x420a
movq %rbp, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7ec5(%rip), %rsi      # 0xc134
leaq 0x7ecd(%rip), %rdx      # 0xc143
leaq 0x38(%rsp), %rdi
callq 0x3c6e
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7f87(%rip), %rsi      # 0xc218
leaq 0x7fac(%rip), %rdx      # 0xc244
leaq 0x18(%rsp), %rdi
callq 0x3c6e
movb $0x1, %bpl
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x3d00
xorl %ebp, %ebp
leaq 0xbad8(%rip), %rsi      # 0xfd98
leaq -0x683(%rip), %rdx      # 0x3c44
movq %rbx, %rdi
callq 0x2190
jmp 0x4354
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7ee9(%rip), %rsi      # 0xc1dd
leaq 0x7eee(%rip), %rdx      # 0xc1e9
leaq 0x78(%rsp), %rdi
callq 0x3c6e
leaq 0x68(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7ed4(%rip), %rsi      # 0xc1ea
leaq 0x7efa(%rip), %rdx      # 0xc217
leaq 0x58(%rsp), %rdi
callq 0x3c6e
movb $0x1, %bpl
leaq 0x78(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x3d00
xorl %ebp, %ebp
leaq 0xba53(%rip), %rsi      # 0xfd98
leaq -0x708(%rip), %rdx      # 0x3c44
movq %rbx, %rdi
callq 0x2190
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x436e
callq 0x2110
jmp 0x436e
movq %rax, %r14
movb $0x1, %bpl
movq 0x78(%rsp), %rdi
jmp 0x4394
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x438f
callq 0x2110
jmp 0x438f
movq %rax, %r14
movb $0x1, %bpl
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x43a8
callq 0x2110
jmp 0x43a8
jmp 0x43a2
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x43b5
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x21c0
nop