// File: bothaynahazem[P]AsuMathLabG13/Matrix2017.cpp
// Function: Matrix::add(Matrix const&)
void Matrix::add(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 0x10f92
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x10fb9
movl $0x8, %edi
callq 0x31c0
movq %rax, %rdi
leaq 0xa4af(%rip), %rax      # 0x1b455
movq %rax, (%rdi)
movq 0x11018(%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 0x111cf
movl $0x0, -0x18(%rbp)
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x111bf
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0xa410(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x11000
jmp 0x1105a
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq 0xa3f6(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x1101a
jmp 0x1105a
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 0x198b0
jmp 0x111af
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0xa39c(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x11074
jmp 0x110cc
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq 0xa382(%rip), %rsi      # 0x1b405
callq 0xaca0
testb $0x1, %al
jne 0x1108e
jmp 0x110cc
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 0x19900
jmp 0x111ad
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0xa32a(%rip), %rsi      # 0x1b405
callq 0xaca0
testb $0x1, %al
jne 0x110e9
jmp 0x11174
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq 0xa30d(%rip), %rsi      # 0x1b405
callq 0xafa0
testb $0x1, %al
jne 0x11103
jmp 0x11174
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 0x19930
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 0x111ab
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 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x111ad
jmp 0x111af
jmp 0x111b1
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x10fd6
jmp 0x111c1
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x10fc0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)