// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movsd %xmm1, -0x78(%rbp)
movsd %xmm0, -0x70(%rbp)
movl %r8d, -0x38(%rbp)
movl %ecx, %r14d
movl %edx, %r13d
movq %rsi, %rbx
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, -0x50(%rbp)
callq 0x31c0
testl %r13d, %r13d
setne %al
testl %r14d, %r14d
setne %cl
testb %al, %cl
je 0x10744
movl %r14d, -0x34(%rbp)
leaq 0xc64(%rip), %rsi       # 0x111f5
movq %rbx, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x10750
movq -0x30(%rbp), %rax
movq $0x0, 0x8(%rax)
movslq %r13d, %rax
shlq $0x3, %rax
testl %r13d, %r13d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x3030
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
testl %r13d, %r13d
jle 0x10750
movl -0x34(%rbp), %eax
movslq %eax, %rcx
shlq $0x4, %rcx
testl %eax, %eax
movq $-0x1, %rdx
movq %rcx, -0x58(%rbp)
cmovnsq %rcx, %rdx
movq %rdx, -0x68(%rbp)
movl %r13d, %ecx
movq %rcx, -0x60(%rbp)
movl %eax, %ebx
shlq $0x4, %rbx
movq $0x0, -0x48(%rbp)
movl -0x38(%rbp), %r15d
leaq 0xb8d(%rip), %r12       # 0x111a4
xorl %r14d, %r14d
movq -0x68(%rbp), %rdi
callq 0x3030
movq %rax, %r13
cmpl $0x0, -0x34(%rbp)
je 0x1063a
movq %r13, %rdi
xorl %esi, %esi
movq -0x58(%rbp), %rdx
callq 0x31d0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %r13, (%rax,%r14,8)
cmpl $0x0, -0x34(%rbp)
jle 0x10730
xorl %r13d, %r13d
cmpl $0x4, -0x38(%rbp)
ja 0x10723
movslq (%r12,%r15,4), %rax
addq %r12, %rax
jmpq *%rax
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r14,8), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax,%r13)
jmp 0x10723
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r14,8), %rax
movsd -0x70(%rbp), %xmm0
movsd %xmm0, (%rax,%r13)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x8(%rax,%r13)
jmp 0x10723
movsd 0xaaa(%rip), %xmm0      # 0x11158
cmpq %r13, -0x48(%rbp)
je 0x106ec
xorpd %xmm0, %xmm0
jmp 0x106ec
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 0xa64(%rip), %xmm0      # 0x11150
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r14,8), %rax
movsd %xmm0, (%rax,%r13)
jmp 0x1071a
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r14,8), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax,%r13)
movq $0x0, 0x8(%rax,%r13)
addq $0x10, %r13
cmpq %r13, %rbx
jne 0x10653
incq %r14
addq $0x10, -0x48(%rbp)
cmpq -0x60(%rbp), %r14
jne 0x1061a
jmp 0x10750
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10761
movq %rax, %rbx
movq -0x50(%rbp), %rax
movq (%rax), %rdi
cmpq -0x40(%rbp), %rdi
je 0x10780
movq -0x40(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x3520