// File: bothaynahazem[P]AsuMathLabG13/main.cpp
// Function: replaceLn(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string replaceLn(string s)
{
	if (s.find("log") != string::npos)
    {
	    string mat_name ="LLT";
		int begin = s.find('(', s.find("log"));
		int end = s.find(')', begin+1);
		string x1 = s.substr(begin+1 , end-begin-1);
		int lengthOfLn = x1.length()+5;
		int start = (s.find("tan"));
		Matrix Y(evaluate(x1));
		Matrix x;
		x=Matrix::log(Y);
//		char buffer[100];
//		sprintf(buffer, "%f", x);
//		string xstr = buffer;
        if(x.getn()==1)
		s.replace(start, lengthOfLn+1, x.getAltString());
		else
        {
            variables_names[in_cntr] = mat_name;
            mat_name+="X";
            input_matrices[in_cntr] = x;
            s.replace(start, lengthOfLn+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 0x144e1(%rip), %rsi     # 0x1b2ad
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
cmpq $-0x1, %rax
je 0x71c7
leaq -0x31(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x3640
movq -0x218(%rbp), %rdx
leaq 0x144b4(%rip), %rsi     # 0x1b2b1
leaq -0x30(%rbp), %rdi
callq 0xab40
jmp 0x6e08
leaq -0x31(%rbp), %rdi
callq 0x3410
movq -0x210(%rbp), %rdi
leaq 0x1448e(%rip), %rsi     # 0x1b2ad
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 0x6e81
leaq -0x70(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x3550
movq -0x210(%rbp), %rdi
addl $0x5, %eax
movl %eax, -0x74(%rbp)
leaq 0x143fb(%rip), %rsi     # 0x1b2a0
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
movq -0x220(%rbp), %rsi
movl %eax, -0x78(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3180
jmp 0x6ec6
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x45e0
jmp 0x6edb
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xf070
jmp 0x6ef0
leaq -0xd0(%rbp), %rdi
callq 0x3270
leaq -0xf0(%rbp), %rdi
callq 0x3270
leaq -0x128(%rbp), %rdi
callq 0xe5d0
jmp 0x6f16
leaq -0x198(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x17440
jmp 0x6f2b
leaq -0x160(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x10e80
jmp 0x6f47
leaq -0x160(%rbp), %rdi
callq 0xe650
leaq -0x198(%rbp), %rdi
callq 0xe650
leaq -0x128(%rbp), %rdi
callq 0xabf0
movl %eax, -0x224(%rbp)
jmp 0x6f73
movl -0x224(%rbp), %eax
cmpl $0x1, %eax
jne 0x70b3
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 0x6fb0
movq -0x230(%rbp), %rdx
movq -0x238(%rbp), %rsi
movq -0x210(%rbp), %rdi
leaq -0x1b8(%rbp), %rcx
callq 0x3150
jmp 0x6fd3
leaq -0x1b8(%rbp), %rdi
callq 0x3270
jmp 0x7159
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3410
jmp 0x722b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x71bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x71b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x7046
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 0x71b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x71a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x719b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xe650
jmp 0x719b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3270
jmp 0x719b
movq 0x1b316(%rip), %rdi     # 0x223d0
movslq 0x1b317(%rip), %rax     # 0x223d8
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3040
jmp 0x70d3
leaq 0x141bd(%rip), %rsi     # 0x1b297
leaq -0x30(%rbp), %rdi
callq 0x33a0
jmp 0x70e5
movq 0x1b2dc(%rip), %rsi     # 0x223c8
movslq 0x1b2e5(%rip), %rax     # 0x223d8
imulq $0x38, %rax, %rax
addq %rax, %rsi
leaq -0x1f0(%rbp), %rdi
leaq -0x128(%rbp), %rdx
callq 0x10e80
jmp 0x710f
leaq -0x1f0(%rbp), %rdi
callq 0xe650
movq -0x210(%rbp), %rdi
movslq -0x78(%rbp), %rsi
movl -0x74(%rbp), %eax
incl %eax
movslq %eax, %rdx
movq 0x1b29b(%rip), %rcx     # 0x223d0
movslq 0x1b29c(%rip), %rax     # 0x223d8
shlq $0x5, %rax
addq %rax, %rcx
callq 0x3150
jmp 0x714a
movl 0x1b288(%rip), %eax     # 0x223d8
addl $0x1, %eax
movl %eax, 0x1b27f(%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 0x721b
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 0x722b
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 0x71f3
leaq -0x1f1(%rbp), %rdi
callq 0x3410
jmp 0x721b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1f1(%rbp), %rdi
callq 0x3410
jmp 0x722b
movq -0x200(%rbp), %rax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3630
nopw %cs:(%rax,%rax)