// File: bothaynahazem[P]AsuMathLabG13/Matrix2017.cpp
// Function: Matrix::sub(Matrix const&)
void Matrix::sub(const Matrix& m)
{
	if (nRows != m.nRows || nColumns != m.nColumns)
		throw("Invalid matrix dimension");
	for (int iR = 0;iR < nRows;iR++)
	{
		for (int iC = 0;iC < nColumns;iC++)
    {
      if((this->type=="complex") && (m.type=="complex"))
        cvalues[iR][iC] -= m.cvalues[iR][iC];
      else if((this->type=="complex") && (m.type!="complex"))
        cvalues[iR][iC] -= m.values[iR][iC];
      else if((this->type!="complex") && (m.type=="complex"))
        cvalues[iR][iC] =values[iR][iC]-m.cvalues[iR][iC];
      else
        values[iR][iC] -= m.values[iR][iC];
    }
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x11572
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x11599
movl $0x8, %edi
callq 0x31c0
movq %rax, %rdi
leaq 0x9ecf(%rip), %rax      # 0x1b455
movq %rax, (%rdi)
movq 0x10a38(%rip), %rsi     # 0x21fc8
xorl %eax, %eax
movl %eax, %edx
callq 0x35f0
movl $0x0, -0x14(%rbp)
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl (%rcx), %eax
jge 0x117b3
movl $0x0, -0x18(%rbp)
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x117a3
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x9e30(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x115e0
jmp 0x1163a
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq 0x9e16(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x115fa
jmp 0x1163a
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rsi
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x19970
jmp 0x11793
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x9dbc(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x11654
jmp 0x116ac
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq 0x9da2(%rip), %rsi      # 0x1b405
callq 0xaca0
testb $0x1, %al
jne 0x1166e
jmp 0x116ac
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x18(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x199c0
jmp 0x11791
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x9d4a(%rip), %rsi      # 0x1b405
callq 0xaca0
testb $0x1, %al
jne 0x116c9
jmp 0x11754
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq 0x9d2d(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x116e3
jmp 0x11754
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x199f0
movq -0x30(%rbp), %rax
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x20(%rbp)
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x1178f
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x18(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm1
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x11791
jmp 0x11793
jmp 0x11795
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x115b6
jmp 0x117a5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x115a0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)