// File: /workspace/github_cpp_makefile_star2_O3/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 0x42a4
movl %ecx, %r14d
testl %ecx, %ecx
jle 0x42a4
movl %edx, %r15d
testl %edx, %edx
jle 0x42a4
testl %r8d, %r8d
jle 0x42a4
movl 0x8(%rsi), %eax
cmpl %r14d, %eax
jl 0x4222
movl 0xc(%rsi), %ecx
cmpl %r8d, %ecx
jl 0x4222
cmpl %r15d, %eax
jb 0x4222
movl %r9d, %ebx
cmpl %r9d, %ecx
jl 0x4222
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 0x3dd4
testl %r14d, %r14d
js 0x420d
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 0x4205
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 0x41f1
incq %rsi
cmpq %r12, %rsi
jne 0x41da
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 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7ef5(%rip), %rsi      # 0xc134
leaq 0x7efd(%rip), %rdx      # 0xc143
leaq 0x18(%rsp), %rdi
callq 0x3c44
leaq 0x68(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7fb7(%rip), %rsi      # 0xc218
leaq 0x7fdc(%rip), %rdx      # 0xc244
leaq 0x58(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xbb08(%rip), %rsi      # 0xfd98
leaq -0x67d(%rip), %rdx      # 0x3c1a
movq %rbx, %rdi
callq 0x2180
jmp 0x4324
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7f1c(%rip), %rsi      # 0xc1dd
leaq 0x7f21(%rip), %rdx      # 0xc1e9
leaq 0x38(%rsp), %rdi
callq 0x3c44
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7f04(%rip), %rsi      # 0xc1ea
leaq 0x7f2a(%rip), %rdx      # 0xc217
leaq 0x78(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x38(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xba83(%rip), %rsi      # 0xfd98
leaq -0x702(%rip), %rdx      # 0x3c1a
movq %rbx, %rdi
callq 0x2180
movq %rax, %r14
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x4336
callq 0x2100
movq 0x38(%rsp), %rdi
jmp 0x435e
movq %rax, %r14
movq 0x38(%rsp), %rdi
jmp 0x4377
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %r12, %rdi
je 0x4359
callq 0x2100
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x4368
callq 0x2100
testb %bpl, %bpl
jne 0x4388
jmp 0x4390
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x4388
callq 0x2100
jmp 0x4388
jmp 0x4385
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
movq %r14, %rdi
callq 0x21b0