// File: /workspace/github_cpp_makefile_star2_O2/gioannides[P]Language_Processors/src/../include/ast/ast_Expressions.cpp
// Function: AssignmentExpression::render_asm(std::basic_ofstream<char, std::char_traits<char>>&, Context&)
inline void AssignmentExpression::render_asm(std::ofstream& file, Context& contxt)  {
			
			if(AssignmentExpressionPtr != NULL) {
				contxt.rhs_of_expression = true;
				AssignmentExpressionPtr->render_asm(file,contxt);
				contxt.rhs_of_expression = false;
			}
			if(UnaryExpressionPtr != NULL && AssignmentOperator != NULL) { //!contxt.reading
				
				contxt.AssignmentOperator = *AssignmentOperator;	
				contxt.lhs_of_assignment = true;
				UnaryExpressionPtr->render_asm(file,contxt);			//TODO: This is for identifier names and values
				
				if(contxt.PointerNotStored){
					if(!contxt.PointerLHSEval){
						file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", " << contxt.Variables[contxt.good_i].offset << "($sp) #" << contxt.Variables[contxt.good_i].id;	
					}
					else{
						if(contxt.Variables[contxt.good_i].DataType == "char"){
						file << std::endl << "\tsb\t$" << contxt.Regs+1 << ", " << "0($" <<  contxt.Regs+2  << ")" << "#" << contxt.Variables[contxt.good_i].id;
			
						}
						else if(contxt.Variables[contxt.good_i].DataType == "short"){
						file << std::endl << "\tsh\t$" << contxt.Regs+1 << ", " << "0($" <<  contxt.Regs+2  << ")" << "#" << contxt.Variables[contxt.good_i].id;
						}
						else if(contxt.Variables[contxt.good_i].DataType != "float"){
						file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", " << "0($" <<  contxt.Regs+2  << ")" << "#" << contxt.Variables[contxt.good_i].id;
						}
						else if(contxt.Variables[contxt.good_i].DataType == "float"){
						file << std::endl << "\tswc1\t$f" << contxt.Regs+1 << ", " << "0($" <<  contxt.Regs+2  << ")" << "#" << contxt.Variables[contxt.good_i].id;
						}
		

					}
					contxt.Variables[contxt.good_i].PointerLevelsTemp = contxt.Variables[contxt.good_i].PointerLevels;
					contxt.regType[contxt.Regs+1]='i';
					contxt.PointerNotStored = false;
				}
				contxt.lhs_of_assignment = false;
				contxt.AssignmentOperator = "df";
				

				
			}				
			else if(ConditionalExpressionPtr != NULL) {
				ConditionalExpressionPtr->render_asm(file,contxt);		//THIS IS FOR IF STATEMENTS/ LOGICAL / ARITHMETIC OPERATIONS / ASSIGNEMENTS
			}
			if(contxt.argument_no.size()>=1 && contxt.argument_no[contxt.argument_no.size()-1])
			{
				file << "\n# merge\n";
				int ki=0;
				
				while(ki<contxt.Variables.size())
				{
					if(contxt.Scopes.size()-contxt.nested_function_calls && contxt.Scopes[contxt.Scopes.size()-contxt.nested_function_calls]==contxt.Variables[ki].scope)
					{ 
						int u=contxt.argument_no[contxt.argument_no.size()-1]-1;
						//file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", " << (contxt.argument_no-1)*4 << "($sp) #";
						if((ki+u)>=0 && contxt.Variables[ki+u].word_size==1) 
						{
							file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", " << u*4 << "($sp) #" << contxt.Variables[ki+u].id << " " << (u)*4;		
							contxt.regType[contxt.Regs+1]='c';
						}				
						else if((ki+u)>=0 && contxt.Variables[ki+u].word_size==4 && contxt.Variables[ki+u].DataType != "float")
						{ 	
							file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", " << (u)*4 << "($sp) #" << contxt.Variables[ki+u].id << " " << (u)*4 << "\n";	
							contxt.regType[contxt.Regs+1]='i';
						}
						else if((ki+u)>=0 && contxt.Variables[ki+u].word_size==2 && contxt.Variables[ki+u].DataType != "float")
						{ 	
							file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", " << u*4 << "($sp) #" << contxt.Variables[ki+u].id << " " << (u)*4 << "\n";	
							contxt.regType[contxt.Regs+1]='i';
						}
						else if((ki+u)>=0 && contxt.Variables[ki+u].word_size==4 && contxt.Variables[ki+u].DataType == "float")
						{
							file << std::endl << "\tswc1\t$f" << contxt.Regs+1 << ", " << (u)*4 << "($sp) #" << contxt.Variables[ki+u].id << " " << u*4 << "\n";	
							contxt.regType[contxt.Regs+1]='f';
						}
						
						if(u<4)
						{
							if((ki+u)>=0 /*&& contxt.regType[u+4] != 'f'/*&& contxt.Variables[ki+contxt.argument_no-1].DataType != "float"*/)
							{
								if(contxt.Variables[ki+u].DataType != "float"){
									file << std::endl << "\tmove\t$" << u+4 << ", $" << contxt.Regs+1 << " #load parameter " << u+1;
								}
								else if(contxt.Variables[ki+u].DataType == "float" && (u+4) == 4){

									file << std::endl << "\tmov.s\t$f12" << ", $f" << contxt.Regs+1 << " #load parameter " << u+1;
									contxt.FloatRegCount+=2;
		
								}
								else if(contxt.Variables[ki+u].DataType == "float" && (u+4) == 5){

									file << std::endl << "\tmov.s\t$f14" << ", $f" << contxt.Regs+1 << " #load parameter " << u+1;
									contxt.FloatRegCount=6;
		
								}
								else if(contxt.Variables[ki+u].DataType == "float" && (u+4) == 6){

									file << std::endl << "\tmfc1\t$6" << ", $f" << contxt.Regs+1 << " #load parameter " << u+1;
									contxt.FloatRegCount=7;
		
								}
								else if(contxt.Variables[ki+u].DataType == "float" && (u+4) == 7){

									file << std::endl << "\tmfc1\t$7"  << ", $f" << contxt.Regs+1 << " #load parameter " << u+1;
									contxt.FloatRegCount=12;
		
								}
								
								
							}
							/*else 
							{
								file << std::endl << "\tmov.s\t$f" << u+4 << ", $f" << contxt.Regs+1 << " #load parameter " << u+1; 
							*///}
						}
						ki=contxt.Variables.size();
					}
					ki++;
					
				}
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r12
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x157d4
movb $0x1, 0x1d1(%rbx)
movq %r13, %rsi
movq %rbx, %rdx
callq 0x1579e
movb $0x0, 0x1d1(%rbx)
cmpq $0x0, 0x10(%r12)
je 0x15877
movq 0x18(%r12), %rsi
testq %rsi, %rsi
je 0x15877
leaq 0x318(%rbx), %r15
movq %r15, %rdi
callq 0x71e0
movb $0x1, 0x1d2(%rbx)
movq 0x10(%r12), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x13056
cmpb $0x1, 0x48(%rbx)
jne 0x15a66
cmpb $0x0, 0x40(%rbx)
je 0x15895
leaq 0x240(%rbx), %r14
leaq 0x5b4(%rbx), %r12
movslq 0x5b4(%rbx), %rax
movq 0x240(%rbx), %rcx
imulq $0xb0, %rax, %rax
leaq (%rcx,%rax), %rdi
addq $0x58, %rdi
leaq 0x17d58(%rip), %rsi     # 0x2d5ae
callq 0x820e
testb %al, %al
je 0x15906
movq %r13, %rdi
callq 0x7190
leaq 0x181a5(%rip), %rsi     # 0x2da17
jmp 0x159ad
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x15a7c
movq %r13, %rsi
movq %rbx, %rdx
callq 0xd786
jmp 0x15a7c
movq %r13, %rdi
callq 0x7190
leaq 0x18165(%rip), %rsi     # 0x2da09
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x18344(%rip), %rsi     # 0x2dc07
movq %rax, %rdi
callq 0x7310
leaq 0x240(%rbx), %r14
leaq 0x5b4(%rbx), %r12
movslq 0x5b4(%rbx), %rcx
movq 0x240(%rbx), %rdx
imulq $0xb0, %rcx, %rcx
movl 0x50(%rdx,%rcx), %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1810e(%rip), %rsi     # 0x2da0f
jmp 0x15a0a
movslq (%r12), %rax
movq (%r14), %rcx
imulq $0xb0, %rax, %rax
leaq (%rcx,%rax), %rdi
addq $0x58, %rdi
leaq 0x17c96(%rip), %rsi     # 0x2d5b9
callq 0x820e
testb %al, %al
je 0x1593d
movq %r13, %rdi
callq 0x7190
leaq 0x180e2(%rip), %rsi     # 0x2da1d
jmp 0x159ad
movslq (%r12), %rax
movq (%r14), %rcx
imulq $0xb0, %rax, %rax
leaq (%rcx,%rax), %rdi
addq $0x58, %rdi
leaq 0x17c35(%rip), %rsi     # 0x2d58f
callq 0x14630
testb %al, %al
je 0x15974
movq %r13, %rdi
callq 0x7190
leaq 0x18097(%rip), %rsi     # 0x2da09
jmp 0x159ad
movslq (%r12), %rax
movq (%r14), %rcx
imulq $0xb0, %rax, %rax
leaq (%rcx,%rax), %rdi
addq $0x58, %rdi
leaq 0x17bfe(%rip), %rsi     # 0x2d58f
callq 0x820e
testb %al, %al
je 0x15a30
movq %r13, %rdi
callq 0x7190
leaq 0x18076(%rip), %rsi     # 0x2da23
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1823b(%rip), %rsi     # 0x2dc07
movq %rax, %rdi
callq 0x7310
leaq 0x17f3d(%rip), %rsi     # 0x2d918
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x18c1e(%rip), %rsi     # 0x2e619
movq %rax, %rdi
callq 0x7310
leaq 0x1838d(%rip), %rsi     # 0x2dd97
movq %rax, %rdi
callq 0x7310
movslq (%r12), %rcx
movq (%r14), %rdx
imulq $0xb0, %rcx, %rcx
leaq (%rdx,%rcx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
movslq 0x5b4(%rbx), %rax
movq 0x240(%rbx), %rcx
imulq $0xb0, %rax, %rax
movl 0xa0(%rcx,%rax), %edx
movl %edx, 0xa4(%rcx,%rax)
movslq 0x310(%rbx), %rax
movb $0x69, 0x342(%rax,%rbx)
movb $0x0, 0x48(%rbx)
movb $0x0, 0x1d2(%rbx)
leaq 0x155ce(%rip), %rsi     # 0x2b042
movq %r15, %rdi
callq 0x7630
movq %r13, (%rsp)
movq 0x498(%rbx), %rax
cmpq 0x490(%rbx), %rax
je 0x1605b
cmpl $0x0, -0x4(%rax)
je 0x1605b
leaq 0x17f87(%rip), %rsi     # 0x2da2c
movq (%rsp), %rdi
callq 0x7310
xorl %ebp, %ebp
movl $0xb0, %r15d
movslq %ebp, %rcx
movq 0x240(%rbx), %rsi
movq 0x248(%rbx), %rax
subq %rsi, %rax
cqto
idivq %r15
cmpq %rcx, %rax
jbe 0x1605b
movq 0x460(%rbx), %rdi
movq 0x468(%rbx), %rax
subq %rdi, %rax
sarq $0x5, %rax
movslq 0x13e98(%rbx), %rdx
subq %rdx, %rax
je 0x15fd0
shlq $0x5, %rax
addq %rax, %rdi
imulq $0xb0, %rcx, %rax
addq %rax, %rsi
addq $0x30, %rsi
callq 0xcbbb
testb %al, %al
je 0x15fd0
movq 0x498(%rbx), %rax
movl -0x4(%rax), %r13d
leal -0x1(%r13), %r12d
addl %r12d, %ebp
js 0x15fba
movl %ebp, %r14d
movq 0x240(%rbx), %rdi
imulq $0xb0, %r14, %r15
movl (%rdi,%r15), %eax
cmpl $0x4, %eax
je 0x15beb
cmpl $0x1, %eax
jne 0x15c0d
movq (%rsp), %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17e98(%rip), %rsi     # 0x2da09
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x18077(%rip), %rsi     # 0x2dc07
callq 0x7310
shll $0x2, %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x7590
movq %rax, %rdi
leaq 0x17e61(%rip), %rsi     # 0x2da0f
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
movq %rax, %rdi
leaq 0x18034(%rip), %rsi     # 0x2dc08
callq 0x7310
movq %rax, %rdi
movl %r12d, %esi
callq 0x7590
movb $0x63, %al
jmp 0x15d93
addq %r15, %rdi
addq $0x58, %rdi
leaq 0x17996(%rip), %rsi     # 0x2d58f
callq 0x14630
testb %al, %al
jne 0x15c31
movq 0x240(%rbx), %rdi
movl (%rdi,%r15), %eax
cmpl $0x2, %eax
jne 0x15cd8
addq %r15, %rdi
addq $0x58, %rdi
leaq 0x1796b(%rip), %rsi     # 0x2d58f
callq 0x14630
testb %al, %al
je 0x15ccd
movq (%rsp), %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17dc5(%rip), %rsi     # 0x2da09
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x17fa4(%rip), %rsi     # 0x2dc07
callq 0x7310
shll $0x2, %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x7590
movq %rax, %rdi
leaq 0x17d8e(%rip), %rsi     # 0x2da0f
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
movq %rax, %rdi
leaq 0x17f61(%rip), %rsi     # 0x2dc08
callq 0x7310
movq %rax, %rdi
movl %r12d, %esi
callq 0x7590
movq %rax, %rdi
leaq 0x17f65(%rip), %rsi     # 0x2dc26
callq 0x7310
movb $0x69, %al
jmp 0x15d93
movq 0x240(%rbx), %rdi
movl (%rdi,%r15), %eax
cmpl $0x4, %eax
jne 0x15da1
addq %r15, %rdi
addq $0x58, %rdi
leaq 0x178a0(%rip), %rsi     # 0x2d58f
callq 0x820e
testb %al, %al
je 0x15da1
movq (%rsp), %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17d14(%rip), %rsi     # 0x2da23
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x17ed9(%rip), %rsi     # 0x2dc07
callq 0x7310
shll $0x2, %r12d
movq %rax, %rdi
movl %r12d, %esi
callq 0x7590
movq %rax, %rdi
leaq 0x17cc3(%rip), %rsi     # 0x2da0f
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
movq %rax, %rdi
leaq 0x17e96(%rip), %rsi     # 0x2dc08
callq 0x7310
movq %rax, %rdi
movl %r12d, %esi
callq 0x7590
movq %rax, %rdi
leaq 0x17e9a(%rip), %rsi     # 0x2dc26
callq 0x7310
movb $0x66, %al
movslq 0x310(%rbx), %rcx
movb %al, 0x342(%rbx,%rcx)
cmpl $0x4, %r13d
movl $0xb0, %r15d
jg 0x15fba
testl %ebp, %ebp
js 0x15fba
movq 0x240(%rbx), %rax
imulq $0xb0, %r14, %r14
leaq (%rax,%r14), %rdi
addq $0x58, %rdi
leaq 0x177b9(%rip), %r12     # 0x2d58f
movq %r12, %rsi
callq 0x14630
testb %al, %al
je 0x15e44
movq (%rsp), %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17c41(%rip), %rsi     # 0x2da36
callq 0x7310
leal 0x3(%r13), %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x1798b(%rip), %rsi     # 0x2d79b
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x17c0f(%rip), %rsi     # 0x2da3e
callq 0x7310
movq %rax, %rdi
movl %r13d, %esi
callq 0x7590
jmp 0x15fba
movq 0x240(%rbx), %rax
leaq (%rax,%r14), %rdi
addq $0x58, %rdi
movq %r12, %rsi
callq 0x820e
cmpl $0x1, %r13d
movq (%rsp), %r15
jne 0x15ec2
testb %al, %al
je 0x15ec2
movq %r15, %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17bd5(%rip), %rsi     # 0x2da50
callq 0x7310
movq %rax, %rdi
leaq 0x179b8(%rip), %rsi     # 0x2d842
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x17b95(%rip), %rsi     # 0x2da3e
callq 0x7310
movq %rax, %rdi
pushq $0x1
popq %rsi
callq 0x7590
addl $0x2, 0x70(%rbx)
jmp 0x15fb4
movq 0x240(%rbx), %rax
leaq (%rax,%r14), %rdi
addq $0x58, %rdi
movq %r12, %rsi
callq 0x820e
cmpl $0x2, %r13d
jne 0x15f3c
testb %al, %al
je 0x15f3c
movq %r15, %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17b67(%rip), %rsi     # 0x2da5c
callq 0x7310
movq %rax, %rdi
leaq 0x1793e(%rip), %rsi     # 0x2d842
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x17b1b(%rip), %rsi     # 0x2da3e
callq 0x7310
movq %rax, %rdi
pushq $0x2
popq %rsi
callq 0x7590
movl $0x6, 0x70(%rbx)
jmp 0x15fb4
movq 0x240(%rbx), %rax
leaq (%rax,%r14), %rdi
addq $0x58, %rdi
movq %r12, %rsi
callq 0x820e
cmpl $0x3, %r13d
jne 0x15fd7
testb %al, %al
je 0x15fd7
movq %r15, %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17af9(%rip), %rsi     # 0x2da68
callq 0x7310
movq %rax, %rdi
leaq 0x178c4(%rip), %rsi     # 0x2d842
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x17aa1(%rip), %rsi     # 0x2da3e
callq 0x7310
movq %rax, %rdi
pushq $0x3
popq %rsi
callq 0x7590
movl $0x7, 0x70(%rbx)
movl $0xb0, %r15d
movq 0x248(%rbx), %rax
subq 0x240(%rbx), %rax
cqto
idivq %r15
movq %rax, %rbp
incl %ebp
jmp 0x15ab6
movq 0x240(%rbx), %rax
leaq (%rax,%r14), %rdi
addq $0x58, %rdi
movq %r12, %rsi
callq 0x820e
cmpl $0x4, %r13d
movl $0xb0, %r15d
jne 0x15fba
testb %al, %al
je 0x15fba
movq (%rsp), %rdi
callq 0x7190
movq %rax, %rdi
leaq 0x17a60(%rip), %rsi     # 0x2da71
callq 0x7310
movq %rax, %rdi
leaq 0x17822(%rip), %rsi     # 0x2d842
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
leaq 0x179ff(%rip), %rsi     # 0x2da3e
callq 0x7310
movq %rax, %rdi
pushq $0x4
popq %rsi
callq 0x7590
movl $0xc, 0x70(%rbx)
jmp 0x15fba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq