// File: /workspace/github_cpp_makefile_star2_O3/IlanPrice[P]Linear-Algebra-Library-in-Cplusplus/Matrix.cpp
// Function: Matrix::getElements(int, int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Vector Matrix:: getElements(int istart, int iend, int jstart, int jend, std::string vector) // when you want the output of a slice to be a vector not a matrix object
{
	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;
	Vector slice(std::max(sRows,sColumns));
	if (sRows == 1)
	{
		for (int j = 0; j<sColumns; j++)
		{
			slice(j+1) = mElements[istart -1][jstart -1 + j];
		}
	}
	else if (sColumns == 1)
	{
		for (int i = 0; i<sRows; i++)
		{
			slice(i+1) = mElements[istart -1 + i][jstart -1];
		}
	}
	else throw Exception("Incorrect dimensions",
			"One of the dimensions of the output must be 1 in order to output a vector");

	return slice;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
testl %r9d, %r9d
jle 0x457c
movl %ecx, %r15d
testl %ecx, %ecx
jle 0x457c
testl %edx, %edx
jle 0x457c
testl %r8d, %r8d
jle 0x457c
movq %rsi, %r14
movl 0x8(%rsi), %eax
cmpl %r15d, %eax
jl 0x44f1
movl 0xc(%r14), %ecx
cmpl %r8d, %ecx
jl 0x44f1
cmpl %edx, %eax
jb 0x44f1
cmpl %r9d, %ecx
jl 0x44f1
movq %rdi, %rbx
movl %r15d, %eax
subl %edx, %eax
leal 0x1(%rax), %esi
movl %r9d, %r13d
subl %r8d, %r13d
leal 0x1(%r13), %r12d
cmpl %r12d, %esi
cmovlel %r12d, %esi
movl %r8d, 0x8(%rsp)
movl %edx, %ebp
movl %r9d, 0x14(%rsp)
callq 0x28b8
movl %ebp, %eax
subl %ebp, %r15d
jne 0x4482
testl %r13d, %r13d
movl 0x8(%rsp), %ebp
js 0x44dc
movl %eax, %r13d
movl %ebp, %eax
leaq -0x8(,%rax,8), %rbp
xorl %r15d, %r15d
movq (%r14), %rax
movq -0x8(%rax,%r13,8), %rax
addq %rbp, %rax
movsd (%rax,%r15,8), %xmm0
movsd %xmm0, 0x8(%rsp)
incq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x3330
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpq %r15, %r12
jne 0x444c
jmp 0x44dc
movl 0x8(%rsp), %ebp
cmpl %ebp, 0x14(%rsp)
jne 0x4607
testl %r15d, %r15d
js 0x44dc
movl %ebp, %r13d
incl %r15d
movl %eax, %eax
leaq -0x8(,%rax,8), %rbp
xorl %r12d, %r12d
movq (%r14), %rax
addq %rbp, %rax
movq (%rax,%r12,8), %rax
movsd -0x8(%rax,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
incq %r12
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3330
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
cmpq %r12, %r15
jne 0x44a8
movq %rbx, %rax
addq $0xd8, %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 0x7c26(%rip), %rsi      # 0xc134
leaq 0x7c2e(%rip), %rdx      # 0xc143
leaq 0x38(%rsp), %rdi
callq 0x3c44
leaq 0xa8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7ce5(%rip), %rsi      # 0xc218
leaq 0x7d0a(%rip), %rdx      # 0xc244
leaq 0x98(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x38(%rsp), %rsi
leaq 0x98(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xb830(%rip), %rsi      # 0xfd98
leaq -0x955(%rip), %rdx      # 0x3c1a
movq %rbx, %rdi
callq 0x2180
jmp 0x4687
movl $0x40, %edi
callq 0x2070
movq %rax, %rbx
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7c44(%rip), %rsi      # 0xc1dd
leaq 0x7c49(%rip), %rdx      # 0xc1e9
leaq 0x58(%rsp), %rdi
callq 0x3c44
leaq 0xc8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7c2c(%rip), %rsi      # 0xc1ea
leaq 0x7c52(%rip), %rdx      # 0xc217
leaq 0xb8(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x58(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xb7a5(%rip), %rsi      # 0xfd98
leaq -0x9e0(%rip), %rdx      # 0x3c1a
movq %rbx, %rdi
callq 0x2180
jmp 0x4687
movl $0x40, %edi
callq 0x2070
movq %rax, %r15
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7d0c(%rip), %rsi      # 0xc331
leaq 0x7d19(%rip), %rdx      # 0xc345
leaq 0x18(%rsp), %rdi
callq 0x3c44
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7cfd(%rip), %rsi      # 0xc346
leaq 0x7d3f(%rip), %rdx      # 0xc38f
leaq 0x78(%rsp), %rdi
callq 0x3c44
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq %r15, %rdi
callq 0x3cdc
xorl %ebp, %ebp
leaq 0xb720(%rip), %rsi      # 0xfd98
leaq -0xa65(%rip), %rdx      # 0x3c1a
movq %r15, %rdi
callq 0x2180
movq %rax, %r14
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x4699
callq 0x2100
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x46a8
callq 0x2100
testb %bpl, %bpl
jne 0x46c9
jmp 0x474c
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x46c9
callq 0x2100
jmp 0x46c9
movq %rax, %r14
movq %r15, %rdi
callq 0x20c0
jmp 0x474c
movq %rax, %r14
movq 0xb8(%rsp), %rdi
cmpq %r12, %rdi
je 0x46e8
callq 0x2100
movq 0x58(%rsp), %rdi
jmp 0x4713
movq %rax, %r14
movq 0x58(%rsp), %rdi
jmp 0x472c
movq %rax, %r14
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x470e
callq 0x2100
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x471d
callq 0x2100
testb %bpl, %bpl
jne 0x473d
jmp 0x4754
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x473d
callq 0x2100
jmp 0x473d
jmp 0x473a
movq %rax, %r14
movq %rbx, %rdi
callq 0x20c0
jmp 0x4754
jmp 0x4749
movq %rax, %r14
movq %rbx, %rdi
callq 0x294e
movq %r14, %rdi
callq 0x21b0