// File: bothaynahazem[P]AsuMathLabG13/main.cpp
// Function: solve(Matrix, Matrix, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Matrix solve(Matrix op1,Matrix op2, string ch)
{
    Matrix X;
	switch (ch[0])
	{
	case '+':
	    X = op1+op2;
	     return X;
	case '-': X = op1-op2;
	     return X;
	case '*': X = op1*op2;
	     return X;
	case '/': if(op2.getn()!=1) X = op1.div(op2);
              else X = op1/op2.getdDeterminant();
         return X;
	case '^': if (op2.getn()==1 && op1.getn()==1)
        X = pow(op1.getDeterminant(),op2.getDeterminant());
        else if(op2.getn()==1)
	    X = Matrix::pow(op1,op2.getDeterminant());
	    return X;
    case '.': if(ch[1]=='+') X = op1+op2.getDeterminant();
	else if(ch[1]=='-') X = op1-op2.getDeterminant();
    else if(ch[1]=='*') X = op1*op2.getDeterminant();
    else if(ch[1]=='/')if(op2.getn()==1) X = op1/op2.getDeterminant();
                        else if(op1.getn()==1) X = op1.rdivide(op1.getDeterminant(),op2);
                        else X = op1.rdivide(op1,op2);
    else if(ch[1]=='^') if (op2.getn()==1)
        X = Matrix::rpow(op1,op2.getDeterminant());
    return X;

	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x710, %rsp            # imm = 0x710
movq %rcx, -0x638(%rbp)
movq %rdx, -0x658(%rbp)
movq %rsi, -0x650(%rbp)
movq %rdi, -0x648(%rbp)
movq %rdi, %rax
movq %rax, -0x640(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
callq 0xe5d0
movq -0x638(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3720
movq %rax, -0x630(%rbp)
jmp 0x7d83
movq -0x630(%rbp), %rax
movsbl (%rax), %eax
addl $-0x2a, %eax
movl %eax, %ecx
movq %rcx, -0x660(%rbp)
subl $0x34, %eax
ja 0x86e9
movq -0x660(%rbp), %rax
leaq 0x13330(%rip), %rcx     # 0x1b0e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x870d
movq -0x658(%rbp), %rdx
movq -0x650(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x113b0
jmp 0x7de6
movq -0x648(%rbp), %rsi
leaq -0x70(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x10e80
jmp 0x7dff
leaq -0x70(%rbp), %rdi
callq 0xe650
leaq -0xa8(%rbp), %rdi
callq 0xe650
movb $0x1, -0x21(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x86eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x658(%rbp), %rdx
movq -0x650(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x11990
jmp 0x7e60
movq -0x648(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x10e80
jmp 0x7e7c
leaq -0xe8(%rbp), %rdi
callq 0xe650
leaq -0x120(%rbp), %rdi
callq 0xe650
movb $0x1, -0x21(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x86eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x120(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x658(%rbp), %rdx
movq -0x650(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x12730
jmp 0x7ee0
movq -0x648(%rbp), %rsi
leaq -0x158(%rbp), %rdi
leaq -0x190(%rbp), %rdx
callq 0x10e80
jmp 0x7efc
leaq -0x158(%rbp), %rdi
callq 0xe650
leaq -0x190(%rbp), %rdi
callq 0xe650
movb $0x1, -0x21(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x86eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x658(%rbp), %rdi
callq 0xabf0
movl %eax, -0x664(%rbp)
jmp 0x7f58
movl -0x664(%rbp), %eax
cmpl $0x1, %eax
je 0x7fd5
movq -0x658(%rbp), %rdx
movq -0x650(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x12930
jmp 0x7f7f
movq -0x648(%rbp), %rsi
leaq -0x1c8(%rbp), %rdi
leaq -0x200(%rbp), %rdx
callq 0x10e80
jmp 0x7f9b
leaq -0x1c8(%rbp), %rdi
callq 0xe650
leaq -0x200(%rbp), %rdi
callq 0xe650
jmp 0x805b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x200(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x658(%rbp), %rdi
callq 0x149a0
movsd %xmm0, -0x670(%rbp)
jmp 0x7feb
movsd -0x670(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x270(%rbp), %rdi
callq 0x12aa0
jmp 0x8008
movq -0x648(%rbp), %rsi
leaq -0x238(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x10e80
jmp 0x8024
leaq -0x238(%rbp), %rdi
callq 0xe650
leaq -0x270(%rbp), %rdi
callq 0xe650
jmp 0x805b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x270(%rbp), %rdi
callq 0xe650
jmp 0x870d
movb $0x1, -0x21(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x86eb
movq -0x658(%rbp), %rdi
callq 0xabf0
movl %eax, -0x674(%rbp)
jmp 0x8082
movl -0x674(%rbp), %eax
cmpl $0x1, %eax
jne 0x8117
movq -0x650(%rbp), %rdi
callq 0xabf0
movl %eax, -0x678(%rbp)
jmp 0x80a5
movl -0x678(%rbp), %eax
cmpl $0x1, %eax
jne 0x8117
movq -0x650(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x680(%rbp)
jmp 0x80c6
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x688(%rbp)
jmp 0x80dc
movsd -0x688(%rbp), %xmm1
movsd -0x680(%rbp), %xmm0
callq 0x3600
movq -0x648(%rbp), %rsi
leaq -0x2a8(%rbp), %rdi
callq 0x10430
jmp 0x8106
leaq -0x2a8(%rbp), %rdi
callq 0xe650
jmp 0x81c2
movq -0x658(%rbp), %rdi
callq 0xabf0
movl %eax, -0x68c(%rbp)
jmp 0x812b
movl -0x68c(%rbp), %eax
cmpl $0x1, %eax
jne 0x81c0
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x698(%rbp)
jmp 0x8150
movsd -0x698(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x318(%rbp), %rdi
callq 0x183f0
jmp 0x816d
movq -0x648(%rbp), %rsi
leaq -0x2e0(%rbp), %rdi
leaq -0x318(%rbp), %rdx
callq 0x10e80
jmp 0x8189
leaq -0x2e0(%rbp), %rdi
callq 0xe650
leaq -0x318(%rbp), %rdi
callq 0xe650
jmp 0x81c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x318(%rbp), %rdi
callq 0xe650
jmp 0x870d
jmp 0x81c2
movb $0x1, -0x21(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x86eb
movq -0x638(%rbp), %rdi
movl $0x1, %esi
callq 0x3720
movq %rax, -0x6a0(%rbp)
jmp 0x81ef
movq -0x6a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x828b
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x6a8(%rbp)
jmp 0x8218
movsd -0x6a8(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x388(%rbp), %rdi
callq 0x11430
jmp 0x8235
movq -0x648(%rbp), %rsi
leaq -0x350(%rbp), %rdi
leaq -0x388(%rbp), %rdx
callq 0x10e80
jmp 0x8251
leaq -0x350(%rbp), %rdi
callq 0xe650
leaq -0x388(%rbp), %rdi
callq 0xe650
jmp 0x86d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x388(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x638(%rbp), %rdi
movl $0x1, %esi
callq 0x3720
movq %rax, -0x6b0(%rbp)
jmp 0x82a5
movq -0x6b0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x8341
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x6b8(%rbp)
jmp 0x82ce
movsd -0x6b8(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x3f8(%rbp), %rdi
callq 0x11a10
jmp 0x82eb
movq -0x648(%rbp), %rsi
leaq -0x3c0(%rbp), %rdi
leaq -0x3f8(%rbp), %rdx
callq 0x10e80
jmp 0x8307
leaq -0x3c0(%rbp), %rdi
callq 0xe650
leaq -0x3f8(%rbp), %rdi
callq 0xe650
jmp 0x86d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x638(%rbp), %rdi
movl $0x1, %esi
callq 0x3720
movq %rax, -0x6c0(%rbp)
jmp 0x835b
movq -0x6c0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x83f7
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x6c8(%rbp)
jmp 0x8384
movsd -0x6c8(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x468(%rbp), %rdi
callq 0x127b0
jmp 0x83a1
movq -0x648(%rbp), %rsi
leaq -0x430(%rbp), %rdi
leaq -0x468(%rbp), %rdx
callq 0x10e80
jmp 0x83bd
leaq -0x430(%rbp), %rdi
callq 0xe650
leaq -0x468(%rbp), %rdi
callq 0xe650
jmp 0x86d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x468(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x638(%rbp), %rdi
movl $0x1, %esi
callq 0x3720
movq %rax, -0x6d0(%rbp)
jmp 0x8411
movq -0x6d0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x85fc
movq -0x658(%rbp), %rdi
callq 0xabf0
movl %eax, -0x6d4(%rbp)
jmp 0x8438
movl -0x6d4(%rbp), %eax
cmpl $0x1, %eax
jne 0x84d0
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x6e0(%rbp)
jmp 0x845d
movsd -0x6e0(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x4d8(%rbp), %rdi
callq 0x12aa0
jmp 0x847a
movq -0x648(%rbp), %rsi
leaq -0x4a0(%rbp), %rdi
leaq -0x4d8(%rbp), %rdx
callq 0x10e80
jmp 0x8496
leaq -0x4a0(%rbp), %rdi
callq 0xe650
leaq -0x4d8(%rbp), %rdi
callq 0xe650
jmp 0x85f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x4d8(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x650(%rbp), %rdi
callq 0xabf0
movl %eax, -0x6e4(%rbp)
jmp 0x84e4
movl -0x6e4(%rbp), %eax
cmpl $0x1, %eax
jne 0x8583
movq -0x650(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x6f0(%rbp)
jmp 0x8509
movq -0x658(%rbp), %rdx
movsd -0x6f0(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x548(%rbp), %rdi
callq 0x14e20
jmp 0x852d
movq -0x648(%rbp), %rsi
leaq -0x510(%rbp), %rdi
leaq -0x548(%rbp), %rdx
callq 0x10e80
jmp 0x8549
leaq -0x510(%rbp), %rdi
callq 0xe650
leaq -0x548(%rbp), %rdi
callq 0xe650
jmp 0x85f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x548(%rbp), %rdi
callq 0xe650
jmp 0x870d
movq -0x658(%rbp), %rcx
movq -0x650(%rbp), %rdx
leaq -0x5b8(%rbp), %rdi
movq %rdx, %rsi
callq 0x15150
jmp 0x85a2
movq -0x648(%rbp), %rsi
leaq -0x580(%rbp), %rdi
leaq -0x5b8(%rbp), %rdx
callq 0x10e80
jmp 0x85be
leaq -0x580(%rbp), %rdi
callq 0xe650
leaq -0x5b8(%rbp), %rdi
callq 0xe650
jmp 0x85f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x5b8(%rbp), %rdi
callq 0xe650
jmp 0x870d
jmp 0x85f7
jmp 0x86d3
movq -0x638(%rbp), %rdi
movl $0x1, %esi
callq 0x3720
movq %rax, -0x6f8(%rbp)
jmp 0x8616
movq -0x6f8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x86d1
movq -0x658(%rbp), %rdi
callq 0xabf0
movl %eax, -0x6fc(%rbp)
jmp 0x863d
movl -0x6fc(%rbp), %eax
cmpl $0x1, %eax
jne 0x86cf
movq -0x658(%rbp), %rdi
callq 0x143a0
movsd %xmm0, -0x708(%rbp)
jmp 0x8662
movsd -0x708(%rbp), %xmm0
movq -0x650(%rbp), %rsi
leaq -0x628(%rbp), %rdi
callq 0x180d0
jmp 0x867f
movq -0x648(%rbp), %rsi
leaq -0x5f0(%rbp), %rdi
leaq -0x628(%rbp), %rdx
callq 0x10e80
jmp 0x869b
leaq -0x5f0(%rbp), %rdi
callq 0xe650
leaq -0x628(%rbp), %rdi
callq 0xe650
jmp 0x86cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x628(%rbp), %rdi
callq 0xe650
jmp 0x870d
jmp 0x86d1
jmp 0x86d3
jmp 0x86d5
jmp 0x86d7
jmp 0x86d9
movb $0x1, -0x21(%rbp)
movl $0x1, -0xac(%rbp)
jmp 0x86eb
ud2
testb $0x1, -0x21(%rbp)
jne 0x86fd
movq -0x648(%rbp), %rdi
callq 0xe650
movq -0x640(%rbp), %rax
addq $0x710, %rsp            # imm = 0x710
popq %rbp
retq
movq -0x648(%rbp), %rdi
callq 0xe650
movq -0x30(%rbp), %rdi
callq 0x3630
nopw %cs:(%rax,%rax)