// File: /workspace/github_cpp_makefile_star2_O3/bothaynahazem[P]AsuMathLabG13/Matrix2017.cpp
// Function: Matrix::Matrix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, std::complex<double>)
Matrix::Matrix(string type,int nRows, int nColumns, int initialization, complex<double> initializationValue)
{
	this->nRows = nRows;
	this->nColumns = nColumns;
	this->type=type;
	if ((nRows*nColumns) == 0)
	{
		cvalues=NULL;
		return;
	}
	if(type=="complex")
    {
    values = NULL;
	cvalues = new complex<double>*[nRows];
	for (int iR = 0;iR<nRows;iR++)
	{
		cvalues[iR] = new complex<double>[nColumns];
		for (int iC = 0;iC<nColumns;iC++)
		{
			switch (initialization)
			{
			case MI_ZEROS:
				cvalues[iR][iC] = 0;
				break;
			case MI_ONES:
				cvalues[iR][iC] = 1;
				break;
			case MI_EYE:
				cvalues[iR][iC] = (iR == iC) ? 1 : 0;
				break;
			case MI_RAND: cvalues[iR][iC] = (rand() % 1000000) / 1000000.0;
				break;
			case MI_VALUE:
				cvalues[iR][iC] = initializationValue;
				break;
			}
		}
	}
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movsd %xmm1, -0x70(%rbp)
movsd %xmm0, -0x68(%rbp)
movl %r8d, -0x38(%rbp)
movl %ecx, %r14d
movl %edx, %ebx
movq %rsi, %r13
movq %rdi, %rcx
leaq 0x18(%rdi), %rdi
leaq 0x28(%rcx), %rax
movq %rax, -0x40(%rbp)
movq %rax, 0x18(%rcx)
movq $0x0, 0x20(%rcx)
movb $0x0, 0x28(%rcx)
movl %edx, (%rcx)
movq %rcx, -0x30(%rbp)
movl %r14d, 0x4(%rcx)
movq %rdi, -0x48(%rbp)
callq 0x31c0
testl %ebx, %ebx
setne %al
testl %r14d, %r14d
setne %cl
testb %al, %cl
je 0x1090e
movl %r14d, -0x34(%rbp)
leaq 0xaa4(%rip), %rsi       # 0x111f5
movq %r13, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x1091a
movq -0x30(%rbp), %rax
movq $0x0, 0x8(%rax)
movl %ebx, %eax
movq %rax, -0x60(%rbp)
leaq (,%rax,8), %rax
testl %ebx, %ebx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
testl %ebx, %ebx
jle 0x1091a
movl -0x34(%rbp), %eax
movslq %eax, %rcx
shlq $0x4, %rcx
testl %eax, %eax
movq $-0x1, %rdx
movq %rcx, -0x50(%rbp)
cmovnsq %rcx, %rdx
movq %rdx, -0x58(%rbp)
movl %eax, %ebx
shlq $0x4, %rbx
xorl %r15d, %r15d
movl -0x38(%rbp), %r14d
xorl %r12d, %r12d
movq -0x58(%rbp), %rdi
callq 0x3030
movq %rax, %r13
movl -0x34(%rbp), %eax
testl %eax, %eax
je 0x108ef
movq %r13, %rdi
xorl %esi, %esi
movq -0x50(%rbp), %rdx
callq 0x31d0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %r13, (%rax,%r12,8)
cmpl $0x0, -0x34(%rbp)
jle 0x108fb
xorl %r13d, %r13d
cmpl $0x4, -0x38(%rbp)
ja 0x108e0
leaq 0x989(%rip), %rcx       # 0x111a4
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax,%r13)
jmp 0x108e0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
movsd -0x68(%rbp), %xmm0
movsd %xmm0, (%rax,%r13)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x8(%rax,%r13)
jmp 0x108e0
movsd 0x8ec(%rip), %xmm0      # 0x11158
cmpq %r13, %r15
je 0x108a9
xorpd %xmm0, %xmm0
jmp 0x108a9
callq 0x30c0
cltq
imulq $0x431bde83, %rax, %rcx # imm = 0x431BDE83
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x32, %rcx
addl %edx, %ecx
imull $0xf4240, %ecx, %ecx    # imm = 0xF4240
subl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x8a7(%rip), %xmm0      # 0x11150
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%r13)
jmp 0x108d7
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r12,8), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax,%r13)
movq $0x0, 0x8(%rax,%r13)
addq $0x10, %r13
cmpq %r13, %rbx
jne 0x1080a
jmp 0x108fb
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %r13, (%rax,%r12,8)
incq %r12
addq $0x10, %r15
cmpq -0x60(%rbp), %r12
jne 0x107cc
jmp 0x1091a
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1092b
movq %rax, %rbx
movq -0x48(%rbp), %rax
movq (%rax), %rdi
cmpq -0x40(%rbp), %rdi
je 0x1094a
movq -0x40(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x3520