// File: bothaynahazem[P]AsuMathLabG13/main.cpp
// Function: replaceSin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string replaceSin(string s)
{
	if (s.find("sin")!=string::npos)
	{
	    string mat_name ="ST";
		int begin = s.find('(', s.find("sin"));
		int end = s.find(')', begin+1);
		string x1 = s.substr(begin+1 , end-begin-1);
		int lengthOfSin = x1.length()+5;
		int start = (s.find("sin"));
		Matrix Y(evaluate(x1));
		Matrix x;
		x=Matrix::sin(Y);
//		char buffer[100];
//		sprintf(buffer, "%f", x);
//		string xstr = buffer;
        if(x.getn()==1)
		s.replace(start, lengthOfSin+1, x.getAltString());
		else
        {
            variables_names[in_cntr] = mat_name;
            mat_name+="X";
            input_matrices[in_cntr] = x;
            s.replace(start, lengthOfSin+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 0x17127(%rip), %rsi     # 0x1b293
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
cmpq $-0x1, %rax
je 0x4567
leaq -0x31(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x3640
movq -0x218(%rbp), %rdx
leaq 0x17125(%rip), %rsi     # 0x1b2c2
leaq -0x30(%rbp), %rdi
callq 0xab40
jmp 0x41a8
leaq -0x31(%rbp), %rdi
callq 0x3410
movq -0x210(%rbp), %rdi
leaq 0x170d4(%rip), %rsi     # 0x1b293
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 0x4221
leaq -0x70(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x3550
movq -0x210(%rbp), %rdi
addl $0x5, %eax
movl %eax, -0x74(%rbp)
leaq 0x1704e(%rip), %rsi     # 0x1b293
xorl %eax, %eax
movl %eax, %edx
callq 0x3710
movq -0x220(%rbp), %rsi
movl %eax, -0x78(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x3180
jmp 0x4266
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x45e0
jmp 0x427b
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xf070
jmp 0x4290
leaq -0xd0(%rbp), %rdi
callq 0x3270
leaq -0xf0(%rbp), %rdi
callq 0x3270
leaq -0x128(%rbp), %rdi
callq 0xe5d0
jmp 0x42b6
leaq -0x198(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x15dc0
jmp 0x42cb
leaq -0x160(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x10e80
jmp 0x42e7
leaq -0x160(%rbp), %rdi
callq 0xe650
leaq -0x198(%rbp), %rdi
callq 0xe650
leaq -0x128(%rbp), %rdi
callq 0xabf0
movl %eax, -0x224(%rbp)
jmp 0x4313
movl -0x224(%rbp), %eax
cmpl $0x1, %eax
jne 0x4453
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 0x4350
movq -0x230(%rbp), %rdx
movq -0x238(%rbp), %rsi
movq -0x210(%rbp), %rdi
leaq -0x1b8(%rbp), %rcx
callq 0x3150
jmp 0x4373
leaq -0x1b8(%rbp), %rdi
callq 0x3270
jmp 0x44f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3410
jmp 0x45cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x455c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4553
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43e6
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 0x4553
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x4547
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x453b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x198(%rbp), %rdi
callq 0xe650
jmp 0x453b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x3270
jmp 0x453b
movq 0x1df76(%rip), %rdi     # 0x223d0
movslq 0x1df77(%rip), %rax     # 0x223d8
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3040
jmp 0x4473
leaq 0x16e1d(%rip), %rsi     # 0x1b297
leaq -0x30(%rbp), %rdi
callq 0x33a0
jmp 0x4485
movq 0x1df3c(%rip), %rsi     # 0x223c8
movslq 0x1df45(%rip), %rax     # 0x223d8
imulq $0x38, %rax, %rax
addq %rax, %rsi
leaq -0x1f0(%rbp), %rdi
leaq -0x128(%rbp), %rdx
callq 0x10e80
jmp 0x44af
leaq -0x1f0(%rbp), %rdi
callq 0xe650
movq -0x210(%rbp), %rdi
movslq -0x78(%rbp), %rsi
movl -0x74(%rbp), %eax
incl %eax
movslq %eax, %rdx
movq 0x1defb(%rip), %rcx     # 0x223d0
movslq 0x1defc(%rip), %rax     # 0x223d8
shlq $0x5, %rax
addq %rax, %rcx
callq 0x3150
jmp 0x44ea
movl 0x1dee8(%rip), %eax     # 0x223d8
addl $0x1, %eax
movl %eax, 0x1dedf(%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 0x45bb
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 0x45cb
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 0x4593
leaq -0x1f1(%rbp), %rdi
callq 0x3410
jmp 0x45bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1f1(%rbp), %rdi
callq 0x3410
jmp 0x45cb
movq -0x200(%rbp), %rax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3630
nopw %cs:(%rax,%rax)