// File: bothaynahazem[P]AsuMathLabG13/main.cpp
// Function: replaceExp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string replaceExp(string s)
{
	if (s.find("exp") != string::npos)
	{
	    string mat_name ="ET";
		int begin = s.find('(', s.find("exp"));
		int end = s.find(')', begin+1);
		string x1 = s.substr(begin+1 , end-begin-1);
		int lengthOfExp = x1.length()+5;
		int start = (s.find("exp"));
		Matrix Y(evaluate(x1));
		Matrix x;
		x=Matrix::exp(Y);
//		char buffer[100];
//		sprintf(buffer, "%f", x);
//		string xstr = buffer;
        if(x.getn()==1)
		s.replace(start, lengthOfExp+1, x.getAltString());
		else
        {
            variables_names[in_cntr] = mat_name;
            mat_name+="X";
            input_matrices[in_cntr] = x;
            s.replace(start, lengthOfExp+1, variables_names[in_cntr]);
            in_cntr++;
        }
        return s;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rsi, -0x210(%rbp)
movq %rdi, %rax
movq -0x210(%rbp), %rdi
movq %rax, -0x208(%rbp)
movq %rax, %rcx
movq %rcx, -0x200(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
leaq 0x14039(%rip), %rsi     # 0x1b2b5
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
cmpq $-0x1, %rax
je 0x7677
leaq -0x31(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x3640
movq -0x218(%rbp), %rdx
leaq 0x1400c(%rip), %rsi     # 0x1b2b9
leaq -0x30(%rbp), %rdi
callq 0xab40
jmp 0x72b8
leaq -0x31(%rbp), %rdi
callq 0x3410
movq -0x210(%rbp), %rdi
leaq 0x13fe6(%rip), %rsi     # 0x1b2b5
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
movq -0x210(%rbp), %rdi
movq %rax, %rdx
movl $0x28, %esi
callq 0x34d0
movq -0x210(%rbp), %rdi
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
incl %eax
movslq %eax, %rdx
movl $0x29, %esi
callq 0x34d0
movq -0x210(%rbp), %rsi
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
movl %eax, %ecx
incl %ecx
movslq %ecx, %rdx
movl -0x4c(%rbp), %ecx
notl %eax
addl %ecx, %eax
movslq %eax, %rcx
leaq -0x70(%rbp), %rdi
callq 0x33e0
jmp 0x7331
leaq -0x70(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x3550
movq -0x210(%rbp), %rdi
addl $0x5, %eax
movl %eax, -0x74(%rbp)
leaq 0x13f60(%rip), %rsi     # 0x1b2b5
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
movq -0x220(%rbp), %rsi
movl %eax, -0x78(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3180
jmp 0x7376
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x45e0
jmp 0x738b
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xf070
jmp 0x73a0
leaq -0xd0(%rbp), %rdi
callq 0x3270
leaq -0xf0(%rbp), %rdi
callq 0x3270
leaq -0x128(%rbp), %rdi
callq 0xe5d0
jmp 0x73c6
leaq -0x198(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x17a20
jmp 0x73db
leaq -0x160(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x10e80
jmp 0x73f7
leaq -0x160(%rbp), %rdi
callq 0xe650
leaq -0x198(%rbp), %rdi
callq 0xe650
leaq -0x128(%rbp), %rdi
callq 0xabf0
movl %eax, -0x224(%rbp)
jmp 0x7423
movl -0x224(%rbp), %eax
cmpl $0x1, %eax
jne 0x7563
movslq -0x78(%rbp), %rax
movq %rax, -0x238(%rbp)
movl -0x74(%rbp), %eax
incl %eax
cltq
movq %rax, -0x230(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x10af0
jmp 0x7460
movq -0x230(%rbp), %rdx
movq -0x238(%rbp), %rsi
movq -0x210(%rbp), %rdi
leaq -0x1b8(%rbp), %rcx
callq 0x3150
jmp 0x7483
leaq -0x1b8(%rbp), %rdi
callq 0x3270
jmp 0x7609
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3410
jmp 0x76db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x766c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x7663
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x74f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x3270
leaq -0xf0(%rbp), %rdi
callq 0x3270
jmp 0x7663
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x7657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x764b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xe650
jmp 0x764b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3270
jmp 0x764b
movq 0x1ae66(%rip), %rdi     # 0x223d0
movslq 0x1ae67(%rip), %rax     # 0x223d8
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3040
jmp 0x7583
leaq 0x13d0d(%rip), %rsi     # 0x1b297
leaq -0x30(%rbp), %rdi
callq 0x33a0
jmp 0x7595
movq 0x1ae2c(%rip), %rsi     # 0x223c8
movslq 0x1ae35(%rip), %rax     # 0x223d8
imulq $0x38, %rax, %rax
addq %rax, %rsi
leaq -0x1f0(%rbp), %rdi
leaq -0x128(%rbp), %rdx
callq 0x10e80
jmp 0x75bf
leaq -0x1f0(%rbp), %rdi
callq 0xe650
movq -0x210(%rbp), %rdi
movslq -0x78(%rbp), %rsi
movl -0x74(%rbp), %eax
incl %eax
movslq %eax, %rdx
movq 0x1adeb(%rip), %rcx     # 0x223d0
movslq 0x1adec(%rip), %rax     # 0x223d8
shlq $0x5, %rax
addq %rax, %rcx
callq 0x3150
jmp 0x75fa
movl 0x1add8(%rip), %eax     # 0x223d8
addl $0x1, %eax
movl %eax, 0x1adcf(%rip)     # 0x223d8
movq -0x210(%rbp), %rsi
movq -0x208(%rbp), %rdi
callq 0x3250
leaq -0x128(%rbp), %rdi
callq 0xe650
leaq -0xb0(%rbp), %rdi
callq 0xe650
leaq -0x70(%rbp), %rdi
callq 0x3270
leaq -0x30(%rbp), %rdi
callq 0x3270
jmp 0x76cb
leaq -0x128(%rbp), %rdi
callq 0xe650
leaq -0xb0(%rbp), %rdi
callq 0xe650
leaq -0x70(%rbp), %rdi
callq 0x3270
leaq -0x30(%rbp), %rdi
callq 0x3270
jmp 0x76db
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x3640
movq -0x208(%rbp), %rdi
movq -0x240(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xab40
jmp 0x76a3
leaq -0x1f1(%rbp), %rdi
callq 0x3410
jmp 0x76cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1f1(%rbp), %rdi
callq 0x3410
jmp 0x76db
movq -0x200(%rbp), %rax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3630
nopw %cs:(%rax,%rax)