// File: /workspace/github_cpp_makefile_star2_O2/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, -0x34(%rbp)
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %rcx
leaq 0x28(%rdi), %rax
movq %rax, 0x18(%rdi)
andq $0x0, 0x20(%rdi)
addq $0x18, %rdi
movb $0x0, 0x28(%rcx)
movl %edx, (%rcx)
movq %rcx, -0x30(%rbp)
movl %r14d, 0x4(%rcx)
movq %rdi, -0x48(%rbp)
callq 0x3200
movl %r14d, %eax
imull %r15d, %eax
testl %eax, %eax
je 0xe49a
leaq 0xef2(%rip), %rsi       # 0xf1f5
movq %rbx, %rdi
callq 0x795a
testb %al, %al
je 0xe4a3
movq -0x30(%rbp), %rax
andq $0x0, 0x8(%rax)
movq %r15, %rbx
movl %ebx, %edi
shlq $0x3, %rdi
testl %ebx, %ebx
pushq $-0x1
popq %r15
cmovsq %r15, %rdi
callq 0x3030
movslq %r14d, %rcx
shlq $0x4, %rcx
xorl %edx, %edx
testl %r14d, %r14d
movq %rcx, -0x50(%rbp)
cmovnsq %rcx, %r15
movq %r15, -0x58(%rbp)
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
movl $0x0, %r12d
cmovgl %r14d, %r12d
testl %ebx, %ebx
movl $0x0, %eax
movq %rax, -0x40(%rbp)
cmovlel %edx, %ebx
movq %rbx, -0x60(%rbp)
shlq $0x4, %r12
movl -0x34(%rbp), %ebx
leaq 0xe26(%rip), %r15       # 0xf1a4
xorl %r13d, %r13d
movl %r14d, -0x38(%rbp)
cmpq -0x60(%rbp), %r13
je 0xe4a3
movq -0x58(%rbp), %rdi
callq 0x3030
movq %rax, %rcx
testl %r14d, %r14d
je 0xe3b4
movq %rcx, %r14
movq %rcx, %rdi
xorl %esi, %esi
movq -0x50(%rbp), %rdx
callq 0x3210
movq %r14, %rcx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax,%r13,8)
xorl %r14d, %r14d
cmpq %r14, %r12
je 0xe489
cmpl $0x4, -0x34(%rbp)
ja 0xe480
movslq (%r15,%rbx,4), %rax
addq %r15, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax,%r14)
jmp 0xe480
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
movsd -0x68(%rbp), %xmm0
movsd %xmm0, (%rax,%r14)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x8(%rax,%r14)
jmp 0xe480
movsd 0xd31(%rip), %xmm0      # 0xf158
cmpq %r14, -0x40(%rbp)
je 0xe44c
xorpd %xmm0, %xmm0
jmp 0xe44c
callq 0x30d0
cltd
movl $0xf4240, %ecx          # imm = 0xF4240
idivl %ecx
cvtsi2sd %edx, %xmm0
divsd 0xd04(%rip), %xmm0      # 0xf150
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
movsd %xmm0, (%rax,%r14)
jmp 0xe47a
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r13,8), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax,%r14)
andq $0x0, 0x8(%rax,%r14)
addq $0x10, %r14
jmp 0xe3c3
incq %r13
addq $0x10, -0x40(%rbp)
movl -0x38(%rbp), %r14d
jmp 0xe385
movq -0x30(%rbp), %rax
andq $0x0, 0x10(%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe4b4
movq %rax, %rbx
movq -0x48(%rbp), %rdi
callq 0x3170
movq %rbx, %rdi
callq 0x3520