// File: /workspace/github_cpp_makefile_star2_O3/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 0x19900(%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 0x19990(%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 0x1e0c0
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 0x19a94(%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 0x19702(%rip), %rsi     # 0x37791
movl $0x3, %edx
movq %rax, %rdi
callq 0x73a0
movl 0x310(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x75c0
leaq 0x1991c(%rip), %rsi     # 0x379cf
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movq 0x240(%rbx), %rdi
movb 0x9c(%rdi,%r12), %al
cmpb $0x1, %al
jne 0x1e0fd
addq %r12, %rdi
addq $0x58, %rdi
leaq 0x194a4(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
jne 0x1e29e
movq 0x240(%rbx), %rdi
movb 0x9c(%rdi,%r12), %al
testb $0x1, %al
je 0x1e123
addq %r12, %rdi
addq $0x58, %rdi
leaq 0x19476(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
je 0x1e29e
movq 0x240(%rbx), %rdi
addq %r12, %rdi
addq $0x58, %rdi
leaq 0x19473(%rip), %rsi     # 0x375a4
callq 0x70c0
testl %eax, %eax
je 0x1e357
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x1a038(%rip), %rsi     # 0x3818c
callq 0x70c0
testl %eax, %eax
je 0x1e19f
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x194dd(%rip), %rsi     # 0x37650
callq 0x70c0
testl %eax, %eax
je 0x1e19f
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x194c0(%rip), %rsi     # 0x37652
callq 0x70c0
testl %eax, %eax
jne 0x1e410
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x193d0(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
je 0x1e410
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 0x19949(%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 0x196f2(%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 0x197c8(%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 0x193d3(%rip), %rsi     # 0x37650
callq 0x70c0
movslq 0x310(%rbx), %rcx
testl %eax, %eax
je 0x1e5a0
movb $0x69, 0x342(%rbx,%rcx)
jmp 0x1e5a8
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 0x1986d(%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 0x19616(%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 0x196ec(%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 0x1e5a8
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 0x197ba(%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 0x1955d(%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 0x19633(%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 0x1e5a8
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x19189(%rip), %rsi     # 0x375af
callq 0x70c0
testl %eax, %eax
je 0x1e547
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x1913c(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
jne 0x1e5a8
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 0x196c7(%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 0x1945e(%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 0x19534(%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 0x191a3(%rip), %rsi     # 0x376cc
movl $0x5, %edx
movq %rax, %rdi
callq 0x73a0
movslq 0x310(%rbx), %rax
movb $0x66, 0x342(%rax,%rbx)
jmp 0x1e5a8
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x19028(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
je 0x1e433
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 0x195ad(%rip), %rsi     # 0x37b48
jmp 0x1e2cf
movb $0x75, 0x342(%rbx,%rcx)
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x19092(%rip), %rsi     # 0x37650
callq 0x70c0
testl %eax, %eax
jne 0x1e5ce
movb $0x1, 0x219(%rbx)
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x18fa1(%rip), %rsi     # 0x37585
callq 0x70c0
testl %eax, %eax
jne 0x1e5f4
movb $0x1, 0x340(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq