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

		file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+2 << ") #" << contxt.Variables[good_index].id;	
		
		contxt.regType[contxt.Regs+1]='i';

	}
	
	else if(contxt.Variables[good_index].DataType == "char") {
		if(contxt.regType[contxt.Regs+1] == 'f'){
			file << std::endl << ".set macro" << std::endl;
			file << std::endl << "\ttrunc.w.s\t$f" << contxt.Regs+1 << ",$f" << contxt.Regs+1 << ",$" << contxt.Regs+1;
			file << std::endl << ".set nomacro" << std::endl;
			file << std::endl << "\tmfc1\t$" << contxt.Regs+1 << ",$f" << contxt.Regs+1;
			file << std::endl << "\tnop" << std::endl;
			if(contxt.regType[contxt.Regs+1] == 'u'){
				file << std::endl << "\tandi\t$" << contxt.Regs+1 << ",$" << contxt.Regs+1 << ",0xFF";
			}
		}
		file << std::endl << "\tsb\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+2 << ") #" << contxt.Variables[good_index].id;
		contxt.regType[contxt.Regs+1]='c';
	}
	else if(contxt.Variables[good_index].DataType=="short" && contxt.Variables[good_index].DataType != "float"){
		if(contxt.regType[contxt.Regs+1] == 'f'){
			file << std::endl << ".set macro" << std::endl;
			file << std::endl << "\ttrunc.w.s\t$f" << contxt.Regs+1 << ",$f" << contxt.Regs+1 << ",$" << contxt.Regs+1;
			file << std::endl << ".set nomacro" << std::endl;
			file << std::endl << "\tmfc1\t$" << contxt.Regs+1 << ",$f" << contxt.Regs+1;
			file << std::endl << "\tnop" << std::endl;
			if(contxt.regType[contxt.Regs+1] == 'u'){
				file << std::endl << "\tandi\t$" << contxt.Regs+1 << ",$" << contxt.Regs+1 << ",0xFF";
			}
		}	
		file << std::endl << "\tsh\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+2 << ") #" << contxt.Variables[good_index].id << "\n";
		contxt.regType[contxt.Regs+1]='i';
	}				
	else if((contxt.Variables[good_index].DataType == "int" || contxt.Variables[good_index].DataType == "signed" || contxt.Variables[good_index].DataType =="unsigned") && contxt.Variables[good_index].DataType != "float"){
		if(contxt.regType[contxt.Regs+1] == 'f'){
			file << std::endl << ".set macro" << std::endl;
			file << std::endl << "\ttrunc.w.s\t$f" << contxt.Regs+1 << ",$f" << contxt.Regs+1 << ",$" << contxt.Regs+1;
			file << std::endl << ".set nomacro" << std::endl;
			file << std::endl << "\tmfc1\t$" << contxt.Regs+1 << ",$f" << contxt.Regs+1;
			file << std::endl << "\tnop" << std::endl;
			if(contxt.regType[contxt.Regs+1] == 'u'){
				file << std::endl << "\tandi\t$" << contxt.Regs+1 << ",$" << contxt.Regs+1 << ",0xFF";
			}
		}	
		file << std::endl << "\tsw\t$" << contxt.Regs+1 << ", 0($" << contxt.Regs+2 << ") #" << contxt.Variables[good_index].id << "\n";
		contxt.regType[contxt.Regs+1]='i';
	}
	else if(contxt.Variables[good_index].DataType == "float"){ //TODO: CHECK OK		
		if(contxt.regType[contxt.Regs+1] != 'f'){
			file << std::endl << "\tmtc1\t$" << contxt.Regs+1 << ",$f" << contxt.Regs+1;
			file << std::endl << "\tcvt.s.w\t$f" << contxt.Regs+1 << ",$f" << contxt.Regs+1;
		}

		file << std::endl << "\tswc1\t$f" << contxt.Regs+1 << ", 0($" << contxt.Regs+2 << ") #" << contxt.Variables[good_index].id << "\n";
		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, %rdi
callq 0x7190
leaq 0x1691f(%rip), %rsi     # 0x2d8e2
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x169b6(%rip), %rsi     # 0x2d999
movq %rax, %rdi
callq 0x7310
movslq %ebp, %rcx
movq 0x240(%rbx), %rdx
imulq $0xb0, %rcx, %r12
movl 0x50(%rdx,%r12), %esi
movq %rax, %rdi
callq 0x7590
cmpl $0x0, 0x13e90(%rbx)
je 0x17069
movq %r14, %rdi
callq 0x7190
leaq 0x16ae5(%rip), %rsi     # 0x2db06
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1675a(%rip), %rsi     # 0x2d79b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16978(%rip), %rsi     # 0x2d9d9
movq %rax, %rdi
callq 0x7310
movq 0x240(%rbx), %rax
movb 0x9c(%rax,%r12), %cl
cmpb $0x1, %cl
jne 0x170b2
movslq 0x5b4(%rbx), %rcx
imulq $0xb0, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x58, %rdi
leaq 0x164f5(%rip), %rsi     # 0x2d58f
callq 0x14630
testb %al, %al
jne 0x170e1
movq 0x240(%rbx), %rax
movb 0x9c(%rax,%r12), %cl
testb $0x1, %cl
je 0x1715a
movslq 0x5b4(%rbx), %rcx
imulq $0xb0, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x58, %rdi
leaq 0x164b7(%rip), %rsi     # 0x2d58f
callq 0x820e
testb %al, %al
je 0x17153
movq %r14, %rdi
callq 0x7190
leaq 0x16919(%rip), %rsi     # 0x2da09
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16807(%rip), %rsi     # 0x2d916
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x168e4(%rip), %rsi     # 0x2da13
movq %rax, %rdi
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
jmp 0x177ca
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x16445(%rip), %rsi     # 0x2d5ae
callq 0x820e
testb %al, %al
je 0x1736c
movslq 0x310(%rbx), %rax
cmpb $0x66, 0x342(%rax,%rbx)
jne 0x172f8
movq %r14, %rdi
callq 0x7190
leaq 0x16468(%rip), %rsi     # 0x2d602
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movq %r14, %rdi
callq 0x7190
leaq 0x16954(%rip), %rsi     # 0x2db0d
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x165a7(%rip), %r15     # 0x2d77f
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16541(%rip), %rsi     # 0x2d73b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x16329(%rip), %rsi     # 0x2d54a
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movq %r14, %rdi
callq 0x7190
leaq 0x168db(%rip), %rsi     # 0x2db1b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x1637a(%rip), %rsi     # 0x2d5fc
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movslq 0x310(%rbx), %rax
cmpb $0x75, 0x342(%rbx,%rax)
jne 0x172f8
movq %r14, %rdi
callq 0x7190
leaq 0x16619(%rip), %rsi     # 0x2d8cb
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1646a(%rip), %rsi     # 0x2d73b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16833(%rip), %rsi     # 0x2db23
movq %rax, %rdi
callq 0x7310
movq %r14, %rdi
callq 0x7190
leaq 0x16710(%rip), %rsi     # 0x2da17
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x165f0(%rip), %rsi     # 0x2d916
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x166cd(%rip), %rsi     # 0x2da13
movq %rax, %rdi
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
movb $0x63, %al
jmp 0x177cc
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x16237(%rip), %rsi     # 0x2d5b9
callq 0x820e
testb %al, %al
je 0x17548
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x161ea(%rip), %rsi     # 0x2d58f
callq 0x14630
testb %al, %al
je 0x17548
movslq 0x310(%rbx), %rax
cmpb $0x66, 0x342(%rax,%rbx)
jne 0x17534
movq %r14, %rdi
callq 0x7190
leaq 0x1622c(%rip), %rsi     # 0x2d602
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movq %r14, %rdi
callq 0x7190
leaq 0x16718(%rip), %rsi     # 0x2db0d
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1636b(%rip), %r15     # 0x2d77f
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16305(%rip), %rsi     # 0x2d73b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x160ed(%rip), %rsi     # 0x2d54a
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movq %r14, %rdi
callq 0x7190
leaq 0x1669f(%rip), %rsi     # 0x2db1b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x1613e(%rip), %rsi     # 0x2d5fc
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movslq 0x310(%rbx), %rax
cmpb $0x75, 0x342(%rbx,%rax)
jne 0x17534
movq %r14, %rdi
callq 0x7190
leaq 0x163dd(%rip), %rsi     # 0x2d8cb
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1622e(%rip), %rsi     # 0x2d73b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x165f7(%rip), %rsi     # 0x2db23
movq %rax, %rdi
callq 0x7310
movq %r14, %rdi
callq 0x7190
leaq 0x164da(%rip), %rsi     # 0x2da1d
jmp 0x1775d
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x16c38(%rip), %rsi     # 0x2e196
callq 0x820e
testb %al, %al
jne 0x175a9
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x160df(%rip), %rsi     # 0x2d65c
callq 0x820e
testb %al, %al
jne 0x175a9
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x160be(%rip), %rsi     # 0x2d65a
callq 0x820e
testb %al, %al
je 0x1782f
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x15fd0(%rip), %rsi     # 0x2d58f
callq 0x14630
testb %al, %al
je 0x1782f
movslq 0x310(%rbx), %rax
cmpb $0x66, 0x342(%rax,%rbx)
jne 0x1774e
movq %r14, %rdi
callq 0x7190
leaq 0x16012(%rip), %rsi     # 0x2d602
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movq %r14, %rdi
callq 0x7190
leaq 0x164fe(%rip), %rsi     # 0x2db0d
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16151(%rip), %r15     # 0x2d77f
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x160eb(%rip), %rsi     # 0x2d73b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x15ed3(%rip), %rsi     # 0x2d54a
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movq %r14, %rdi
callq 0x7190
leaq 0x16485(%rip), %rsi     # 0x2db1b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x15f24(%rip), %rsi     # 0x2d5fc
movq %rax, %rdi
callq 0x7310
movq %rax, %rdi
callq 0x7190
movslq 0x310(%rbx), %rax
cmpb $0x75, 0x342(%rbx,%rax)
jne 0x1774e
movq %r14, %rdi
callq 0x7190
leaq 0x161c3(%rip), %rsi     # 0x2d8cb
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16014(%rip), %rsi     # 0x2d73b
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x163dd(%rip), %rsi     # 0x2db23
movq %rax, %rdi
callq 0x7310
movq %r14, %rdi
callq 0x7190
leaq 0x162ac(%rip), %rsi     # 0x2da09
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x1619a(%rip), %rsi     # 0x2d916
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x16277(%rip), %rsi     # 0x2da13
movq %rax, %rdi
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
leaq 0x16464(%rip), %rsi     # 0x2dc26
movq %rax, %rdi
callq 0x7310
movb $0x69, %al
movslq 0x310(%rbx), %rcx
movb %al, 0x342(%rcx,%rbx)
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x15e6a(%rip), %rsi     # 0x2d65a
callq 0x820e
testb %al, %al
je 0x17800
movb $0x1, 0x219(%rbx)
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x15d79(%rip), %rsi     # 0x2d58f
callq 0x820e
testb %al, %al
je 0x17826
movb $0x1, 0x340(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x240(%rbx), %rax
leaq (%rax,%r12), %rdi
addq $0x58, %rdi
leaq 0x15d4a(%rip), %rsi     # 0x2d58f
callq 0x820e
testb %al, %al
je 0x177da
movslq 0x310(%rbx), %rax
cmpb $0x66, 0x342(%rax,%rbx)
je 0x178ee
movq %r14, %rdi
callq 0x7190
leaq 0x1625a(%rip), %rsi     # 0x2dacc
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x15eee(%rip), %r15     # 0x2d77f
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x1626e(%rip), %rsi     # 0x2db29
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %rax, %rdi
movq %r15, %rsi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
movq %r14, %rdi
callq 0x7190
leaq 0x16126(%rip), %rsi     # 0x2da23
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
incl %esi
movq %rax, %rdi
callq 0x7590
leaq 0x15ffa(%rip), %rsi     # 0x2d916
movq %rax, %rdi
callq 0x7310
movl 0x310(%rbx), %esi
addl $0x2, %esi
movq %rax, %rdi
callq 0x7590
leaq 0x160d7(%rip), %rsi     # 0x2da13
movq %rax, %rdi
callq 0x7310
movq 0x240(%rbx), %rcx
leaq (%rcx,%r12), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x72d0
leaq 0x162c4(%rip), %rsi     # 0x2dc26
movq %rax, %rdi
callq 0x7310
movb $0x66, %al
jmp 0x177cc