// File: /workspace/github_cpp_makefile_star2_O2/bothaynahazem[P]AsuMathLabG13/Matrix2017.cpp
// Function: Matrix::mul(Matrix&)
void Matrix::mul(Matrix& m)
{
	if(this->type=="complex"&& m.type=="complex"){

	if (nColumns != m.nRows) //that's how matrices are multiplied
		throw("Invalid matrix dimension for multiplication");

	Matrix r("complex",nRows, m.nColumns); //the dim of the product matrix

	for (int iR = 0; iR<r.nRows; iR++)
	{
		for (int iC = 0; iC < r.nColumns; iC++)
		{
			r.cvalues[iR][iC] = 0; //initializing this particular element of the matrix with zero

			for (int k = 0; k < m.nColumns; k++)
				r.cvalues[iR][iC] += cvalues[iR][k] * m.cvalues[k][iC];
		}
	}
 copy(r);
}
else if(this->type=="complex" && m.type!="complex"){

	if (nColumns != m.nRows) //that's how matrices are multiplied
		throw("Invalid matrix dimension for multiplication");

	Matrix r("complex",nRows, m.nColumns); //the dim of the product matrix

	for (int iR = 0; iR<r.nRows; iR++)
	{
		for (int iC = 0; iC < r.nColumns; iC++)
		{
			r.cvalues[iR][iC] = 0; //initializing this particular element of the matrix with zero

			for (int k = 0; k < m.nColumns; k++)
				r.cvalues[iR][iC] += cvalues[iR][k] * m.values[k][iC];
		}
	}
 copy(r);
}
else if(this->type!="complex" && m.type=="complex"){

	if (nColumns != m.nRows) //that's how matrices are multiplied
		throw("Invalid matrix dimension for multiplication");

	Matrix r("complex",nRows, m.nColumns); //the dim of the product matrix

	for (int iR = 0; iR<r.nRows; iR++)
	{
		for (int iC = 0; iC < r.nColumns; iC++)
		{
			r.cvalues[iR][iC] = 0; //initializing this particular element of the matrix with zero

			for (int k = 0; k < m.nColumns; k++)
				r.cvalues[iR][iC] += values[iR][k] * m.cvalues[k][iC];
		}
	}
 copy(r);
}
else{
	if (nColumns != m.nRows) //that's how matrices are multiplied
		throw("Invalid matrix dimension for multiplication");

	Matrix r(nRows, m.nColumns); //the dim of the product matrix

	for (int iR = 0; iR<r.nRows; iR++)
	{
		for (int iC = 0; iC < r.nColumns; iC++)
		{
			r.values[iR][iC] = 0; //initializing this particular element of the matrix with zero

			for (int k = 0; k < m.nColumns; k++)
				r.values[iR][iC] += values[iR][k] * m.values[k][iC];
		}
	}

	copy(r);
}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r14
movq %rdi, %r13
leaq 0x18(%rdi), %r15
leaq 0x4ba6(%rip), %rsi      # 0xf1f5
movq %r15, %rdi
callq 0x795a
testb %al, %al
je 0xa780
leaq 0x18(%r14), %rdi
leaq 0x4b8b(%rip), %rsi      # 0xf1f5
callq 0x795a
testb %al, %al
je 0xa780
movl 0x4(%r13), %eax
cmpl (%r14), %eax
jne 0xaab1
leaq 0x4b6a(%rip), %rsi      # 0xf1f5
leaq -0xd8(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x7844
movl (%r13), %edx
movl 0x4(%r14), %ecx
leaq -0x68(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
callq 0xe29a
leaq -0xd8(%rbp), %rdi
callq 0x3170
xorl %r15d, %r15d
movq %r13, -0x70(%rbp)
movslq -0x68(%rbp), %rax
cmpq %rax, %r15
jge 0xaa6e
xorl %edx, %edx
movslq -0x64(%rbp), %rax
cmpq %rax, %rdx
jge 0xa778
movq -0x58(%rbp), %rax
movq (%rax,%r15,8), %rax
movq %rdx, -0x78(%rbp)
movq %rdx, %r13
shlq $0x4, %r13
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax,%r13)
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %r14, %rcx
movslq 0x4(%r14), %rax
cmpq %rax, %rbx
jge 0xa765
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax,%r15,8), %rdi
addq %r12, %rdi
movq 0x10(%rcx), %rax
movq (%rax,%rbx,8), %rsi
addq %r13, %rsi
callq 0xe4c8
movq -0x58(%rbp), %rax
movq (%rax,%r15,8), %rax
addsd (%rax,%r13), %xmm0
addsd 0x8(%rax,%r13), %xmm1
movsd %xmm0, (%rax,%r13)
movsd %xmm1, 0x8(%rax,%r13)
incq %rbx
addq $0x10, %r12
jmp 0xa70f
movq -0x78(%rbp), %rdx
incq %rdx
movq -0x70(%rbp), %r13
movq %rcx, %r14
jmp 0xa6e0
incq %r15
jmp 0xa6d1
leaq 0x4a6e(%rip), %rsi      # 0xf1f5
movq %r15, %rdi
callq 0x795a
testb %al, %al
je 0xa8a8
leaq 0x18(%r14), %rdi
leaq 0x4a53(%rip), %rsi      # 0xf1f5
callq 0x78c0
testb %al, %al
je 0xa8a8
movl 0x4(%r13), %eax
cmpl (%r14), %eax
jne 0xaab1
leaq 0x4a32(%rip), %rsi      # 0xf1f5
leaq -0xb8(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x7844
movl (%r13), %edx
movl 0x4(%r14), %ecx
leaq -0x68(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
callq 0xe29a
leaq -0xb8(%rbp), %rdi
callq 0x3170
xorl %eax, %eax
xorpd %xmm0, %xmm0
pushq $0x8
popq %rcx
movslq -0x68(%rbp), %rdx
cmpq %rdx, %rax
jge 0xaa7c
xorl %edx, %edx
movslq -0x64(%rbp), %rsi
cmpq %rsi, %rdx
jge 0xa8a0
movq -0x58(%rbp), %rsi
movq (%rsi,%rax,8), %rdi
movq %rdx, %rsi
shlq $0x4, %rsi
movupd %xmm0, (%rdi,%rsi)
movq %rcx, %rdi
xorl %r8d, %r8d
movslq 0x4(%r14), %r9
cmpq %r9, %r8
jge 0xa898
movq 0x10(%r13), %r9
movq (%r9,%rax,8), %r9
movq 0x8(%r14), %r10
movq (%r10,%r8,8), %r10
movsd (%r10,%rdx,8), %xmm1
movsd -0x8(%r9,%rdi), %xmm2
mulsd %xmm1, %xmm2
mulsd (%r9,%rdi), %xmm1
movq -0x58(%rbp), %r9
movq (%r9,%rax,8), %r9
addsd (%r9,%rsi), %xmm2
addsd 0x8(%r9,%rsi), %xmm1
movsd %xmm2, (%r9,%rsi)
movsd %xmm1, 0x8(%r9,%rsi)
incq %r8
addq $0x10, %rdi
jmp 0xa83d
incq %rdx
jmp 0xa81a
incq %rax
jmp 0xa80b
leaq 0x4946(%rip), %rsi      # 0xf1f5
movq %r15, %rdi
callq 0x78c0
testb %al, %al
je 0xa9bd
leaq 0x18(%r14), %rdi
leaq 0x492b(%rip), %rsi      # 0xf1f5
callq 0x795a
testb %al, %al
je 0xa9bd
movl 0x4(%r13), %eax
cmpl (%r14), %eax
jne 0xaab1
leaq 0x490a(%rip), %rsi      # 0xf1f5
leaq -0x98(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x7844
movl (%r13), %edx
movl 0x4(%r14), %ecx
leaq -0x68(%rbp), %rdi
leaq -0x98(%rbp), %rsi
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
callq 0xe29a
leaq -0x98(%rbp), %rdi
callq 0x3170
xorl %eax, %eax
xorpd %xmm0, %xmm0
movslq -0x68(%rbp), %rcx
cmpq %rcx, %rax
jge 0xaa8a
xorl %ecx, %ecx
movslq -0x64(%rbp), %rdx
cmpq %rdx, %rcx
jge 0xa9b5
movq -0x58(%rbp), %rdx
movq (%rdx,%rax,8), %rsi
movq %rcx, %rdx
shlq $0x4, %rdx
movupd %xmm0, (%rsi,%rdx)
xorl %esi, %esi
movslq 0x4(%r14), %rdi
cmpq %rdi, %rsi
jge 0xa9b0
movq 0x8(%r13), %rdi
movq (%rdi,%rax,8), %rdi
movq 0x10(%r14), %r8
movq (%r8,%rsi,8), %r8
movsd (%rdi,%rsi,8), %xmm1
movsd (%r8,%rdx), %xmm2
mulsd %xmm1, %xmm2
mulsd 0x8(%r8,%rdx), %xmm1
movq -0x58(%rbp), %rdi
movq (%rdi,%rax,8), %rdi
addsd (%rdi,%rdx), %xmm2
addsd 0x8(%rdi,%rdx), %xmm1
movsd %xmm2, (%rdi,%rdx)
movsd %xmm1, 0x8(%rdi,%rdx)
incq %rsi
jmp 0xa95e
incq %rcx
jmp 0xa93f
incq %rax
jmp 0xa930
movl 0x4(%r13), %eax
cmpl (%r14), %eax
jne 0xaab1
movl (%r13), %esi
movl 0x4(%r14), %edx
leaq -0x68(%rbp), %r15
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x8ace
movl (%r15), %eax
movl 0x4(%r15), %ecx
testl %ecx, %ecx
cmovlel %r12d, %ecx
testl %eax, %eax
cmovlel %r12d, %eax
xorl %edx, %edx
cmpq %rax, %rdx
je 0xaa60
movq -0x60(%rbp), %rsi
movl 0x4(%r14), %edi
testl %edi, %edi
cmovlel %r12d, %edi
xorl %r8d, %r8d
cmpq %rcx, %r8
je 0xaa5b
movq (%rsi,%rdx,8), %r9
andq $0x0, (%r9,%r8,8)
movq 0x8(%r13), %r10
movq 0x8(%r14), %r11
xorpd %xmm0, %xmm0
xorl %ebx, %ebx
cmpq %rbx, %rdi
je 0xaa56
movq (%r10,%rdx,8), %r15
movsd (%r15,%rbx,8), %xmm1
movq (%r11,%rbx,8), %r15
mulsd (%r15,%r8,8), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, (%r9,%r8,8)
incq %rbx
jmp 0xaa2e
incq %r8
jmp 0xaa12
incq %rdx
jmp 0xa9fc
leaq -0x68(%rbp), %rsi
movq %r13, %rdi
callq 0x8dee
jmp 0xaa96
leaq -0x68(%rbp), %rsi
movq %r13, %rdi
callq 0x8dee
jmp 0xaa96
leaq -0x68(%rbp), %rsi
movq %r13, %rdi
callq 0x8dee
jmp 0xaa96
leaq -0x68(%rbp), %rsi
movq %r13, %rdi
callq 0x8dee
leaq -0x68(%rbp), %rdi
callq 0x8a24
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x31a0
leaq 0x479e(%rip), %rcx      # 0xf25e
movq %rcx, (%rax)
movq 0x94fe(%rip), %rsi      # 0x13fc8
movq %rax, %rdi
xorl %edx, %edx
callq 0x34e0
jmp 0xab0e
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0xab00
jmp 0xab07
jmp 0xab0e
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0xab00
jmp 0xab07
jmp 0xab0e
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x3170
jmp 0xab1a
movq %rax, %rbx
jmp 0xab1a
jmp 0xab0e
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x8a24
movq %rbx, %rdi
callq 0x3520