// File: /workspace/github_cpp_makefile_star2_O1/gioannides[P]Language_Processors/src/../include/ast/class_forward_declarations.hpp
// Function: load_locals(Context&, std::basic_ofstream<char, std::char_traits<char>>&, int)
inline void load_locals(Context& contxt, std::ofstream& file, int good_index)
{
	file << std::endl << "\taddiu $" << contxt.Regs+1 << ", $sp, " << contxt.Variables[good_index].offset; 
	if(contxt.nested_arrays){
		file << std::endl << "\tadd $" << contxt.Regs+1 << ", $" << contxt.Regs+1 << ", $25";				
	}
	if(contxt.Variables[good_index].Pointer && contxt.Variables[good_index].DataType != "float"){
		//file << std::endl << "\tlw\t$" << contxt.Regs+1 << ", " << contxt.Variables[good_index].offset << "($sp) #" << contxt.Variables[good_index].id;
		file << std::endl << "\tlw\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+1 << ") #" << contxt.Variables[good_index].id;	
		
		
			contxt.regType[contxt.Regs+1]='i';
		
	}
	else if(contxt.Variables[good_index].Pointer && contxt.Variables[good_index].DataType == "float"){
		
		//file << std::endl << "\tlw\t$" << contxt.Regs+1 << ", " << contxt.Variables[good_index].offset << "($sp) #" << contxt.Variables[good_index].id;
		file << std::endl << "\tlw\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+1 << ") #" << contxt.Variables[good_index].id;	

		contxt.regType[contxt.Regs+1]='i';
	}
	
			
	else if(contxt.Variables[good_index].DataType == "char" )  
	{
		//file << std::endl << "\tlb\t$" << contxt.Regs+1 << ", " << contxt.Variables[good_index].offset << "($sp) #" << contxt.Variables[good_index].id;
		file << std::endl << "\tlb\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+1 << ") #" << contxt.Variables[good_index].id;	
		
		contxt.regType[contxt.Regs+1]='c';
	}
	else if( (contxt.Variables[good_index].DataType == "int" ||contxt.Variables[good_index].DataType == "unsigned" || contxt.Variables[good_index].DataType =="signed") && contxt.Variables[good_index].DataType != "float")
	{
		//file << std::endl << "\tlw\t$" << contxt.Regs+1 << ", " << contxt.Variables[good_index].offset << "($sp) #" << contxt.Variables[good_index].id;	
		file << std::endl << "\tlw\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+1 << ") #" << contxt.Variables[good_index].id;	
		
		if(contxt.Variables[good_index].DataType=="unsigned"){
			contxt.regType[contxt.Regs+1]='u';
		}	
		else{
			contxt.regType[contxt.Regs+1]='i';
		}		
			
	}
	else if(contxt.Variables[good_index].DataType== "short" && contxt.Variables[good_index].DataType != "float")
	{
		//file << std::endl << "\tlh\t$" << contxt.Regs+1 << ", " << contxt.Variables[good_index].offset << "($sp) #" << contxt.Variables[good_index].id;			
		file << std::endl << "\tlh\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+1 << ") #" << contxt.Variables[good_index].id;	
		
		contxt.regType[contxt.Regs+1]='i';					
	}
	else if(contxt.Variables[good_index].DataType == "float") //TODO: CHECK OK
	{
		//file << std::endl << "\tlwc1\t$f" << contxt.Regs+1 << ", " << contxt.Variables[good_index].offset << "($sp) #" << contxt.Variables[good_index].id;
		file << std::endl << "\tlwc1\t$f" << contxt.Regs+1 << ", 0($" << contxt.Regs+1 << ") #" << contxt.Variables[good_index].id;	
		
		file << std::endl << "\tnop\t";
		contxt.regType[contxt.Regs+1]='f';		
	}
	if(contxt.Variables[good_index].DataType == "unsigned") 
				{
					contxt.is_unsigned = true;			
				}
				if(contxt.Variables[good_index].DataType == "float") {
					contxt.float_ = true;
				}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq -0x18(%rax), %rdi
addq %rsi, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r15
leaq 0x190e0(%rip), %rsi     # 0x378d8
movl $0x8, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x75c0
movq %rax, %r15
leaq 0x19170(%rip), %rsi     # 0x3798f
movl $0x7, %edx
movq %rax, %rdi
callq 0x73a0
movslq %ebp, %rax
movq 0x240(%rbx), %rcx
imulq $0xb0, %rax, %r12
movl 0x50(%rcx,%r12), %esi
movq %r15, %rdi
callq 0x75c0
cmpl $0x0, 0x13e90(%rbx)
je 0x1e8e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r15
leaq 0x19274(%rip), %rsi     # 0x37afc
movl $0x6, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x75c0
movq %rax, %r15
leaq 0x18ee2(%rip), %rsi     # 0x37791
movl $0x3, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x75c0
leaq 0x190fc(%rip), %rsi     # 0x379cf
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movq 0x240(%rbx), %rdi
cmpb $0x1, 0x9c(%rdi,%r12)
jne 0x1e90d
addq %r12, %rdi
addq $0x58, %rdi
leaq 0x18c85(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
jne 0x1eabd
movq 0x240(%rbx), %rdi
cmpb $0x1, 0x9c(%rdi,%r12)
jne 0x1e93a
addq %r12, %rdi
addq $0x58, %rdi
leaq 0x18c58(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
je 0x1eabd
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18c54(%rip), %rsi     # 0x375a4
callq 0x70c0
testl %eax, %eax
je 0x1eb76
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x19819(%rip), %rsi     # 0x3818c
callq 0x70c0
testl %eax, %eax
je 0x1e9be
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18cbe(%rip), %rsi     # 0x37650
callq 0x70c0
testl %eax, %eax
je 0x1e9be
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18ca1(%rip), %rsi     # 0x37652
callq 0x70c0
testl %eax, %eax
jne 0x1ec2f
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18bb1(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
je 0x1ec2f
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r14
leaq 0x1912a(%rip), %rsi     # 0x37b3c
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x75c0
movq %rax, %r14
leaq 0x18ed3(%rip), %rsi     # 0x3790c
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x75c0
movq %rax, %r14
leaq 0x18fa9(%rip), %rsi     # 0x37a09
movl $0x3, %edx
movq %rax, %rdi
callq 0x73a0
movq 0x240(%rbx), %rax
movq 0x8(%rax,%r12), %rsi
movq 0x10(%rax,%r12), %rdx
movq %r14, %rdi
callq 0x73a0
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18bb4(%rip), %rsi     # 0x37650
callq 0x70c0
movslq 0x310(%rbx), %rcx
testl %eax, %eax
je 0x1edbf
movb $0x69, 0x342(%rbx,%rcx)
jmp 0x1edc7
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r14
leaq 0x1904e(%rip), %rsi     # 0x37b3c
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x75c0
movq %rax, %r14
leaq 0x18df7(%rip), %rsi     # 0x3790c
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x75c0
movq %rax, %r14
leaq 0x18ecd(%rip), %rsi     # 0x37a09
movl $0x3, %edx
movq %rax, %rdi
callq 0x73a0
movq 0x240(%rbx), %rax
movq 0x8(%rax,%r12), %rsi
movq 0x10(%rax,%r12), %rdx
movq %r14, %rdi
callq 0x73a0
movslq 0x310(%rbx), %rax
movb $0x69, 0x342(%rax,%rbx)
jmp 0x1edc7
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r14
leaq 0x18f9b(%rip), %rsi     # 0x37b42
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x75c0
movq %rax, %r14
leaq 0x18d3e(%rip), %rsi     # 0x3790c
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r14, %rdi
callq 0x75c0
movq %rax, %r14
leaq 0x18e14(%rip), %rsi     # 0x37a09
movl $0x3, %edx
movq %rax, %rdi
callq 0x73a0
movq 0x240(%rbx), %rax
movq 0x8(%rax,%r12), %rsi
movq 0x10(%rax,%r12), %rdx
movq %r14, %rdi
callq 0x73a0
movslq 0x310(%rbx), %rax
movb $0x63, 0x342(%rax,%rbx)
jmp 0x1edc7
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x1896a(%rip), %rsi     # 0x375af
callq 0x70c0
testl %eax, %eax
je 0x1ed66
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x1891d(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
jne 0x1edc7
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r15
leaq 0x18ea8(%rip), %rsi     # 0x37b4e
movl $0x8, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x75c0
movq %rax, %r15
leaq 0x18c3f(%rip), %rsi     # 0x3790c
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x75c0
movq %rax, %r15
leaq 0x18d15(%rip), %rsi     # 0x37a09
movl $0x3, %edx
movq %rax, %rdi
callq 0x73a0
movq 0x240(%rbx), %rax
movq 0x8(%rax,%r12), %rsi
movq 0x10(%rax,%r12), %rdx
movq %r15, %rdi
callq 0x73a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
leaq 0x18984(%rip), %rsi     # 0x376cc
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movslq 0x310(%rbx), %rax
movb $0x66, 0x342(%rax,%rbx)
jmp 0x1edc7
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18809(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
je 0x1ec52
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x7220
movq %rax, %r14
leaq 0x18d8e(%rip), %rsi     # 0x37b48
jmp 0x1eaee
movb $0x75, 0x342(%rbx,%rcx)
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18873(%rip), %rsi     # 0x37650
callq 0x70c0
testl %eax, %eax
jne 0x1eded
movb $0x1, 0x219(%rbx)
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18782(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
jne 0x1ee13
movb $0x1, 0x340(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq