// File: gioannides[P]Language_Processors/src/../include/ast/class_forward_declarations.hpp
// Function: postfix_ops(Context&, std::basic_ofstream<char, std::char_traits<char>>&)
inline void postfix_ops(Context& contxt, std::ofstream& f) //this needs to be fixed for globals
{
	contxt.Regs++;
	int index = contxt.good_i;
	if(contxt.AssignmentOperator == "++" && contxt.is_postfix && !contxt.reading)
	{ 
		
		if(contxt.regType[contxt.Regs+1] == 'f'){
			if(contxt.Variables[contxt.good_i].scope=="global")
			{
				load_globals(contxt, f, index);
			}
			else 
			{
				load_locals(contxt, f, index);
			
			}		
			f << std::endl << "\tli.s\t$f" << contxt.Regs+2 << ",1";
			contxt.regType[contxt.Regs]='f';
			f << std::endl << "\tadd.s\t$f" << contxt.Regs+1 << ",$f" << contxt.Regs+1 << ",$f" << contxt.Regs+2;
			contxt.regType[contxt.Regs+1]='f';
		}
		else{
			if(contxt.Variables[contxt.good_i].scope=="global")
			{
				load_globals(contxt, f, index);
			}
			else 
			{
				load_locals(contxt, f, index);
			
			}
	
			f << "\n\taddi\t$" << contxt.Regs+1 << ", $" << contxt.Regs+1 << ", 1 #++";
		}
					
		if(contxt.Variables[contxt.good_i].scope=="global")
		{
			store_globals(contxt, f, index);
		}
		else 
		{
			store_locals(contxt, f, index);
			
		}
		
		contxt.is_postfix=false;
	}
	else if (contxt.AssignmentOperator == "--" && contxt.is_postfix && !contxt.reading)
	{
		
		if(contxt.regType[contxt.Regs+1] == 'f'){
			if(contxt.Variables[contxt.good_i].scope=="global")
			{
				load_globals(contxt, f, index);
			}
			else 
			{
				load_locals(contxt, f, index);
			
			}				
			f << std::endl << "\tli.s\t$f" << contxt.Regs+2 << ",-1";
			contxt.regType[contxt.Regs]='f';
			f << std::endl << "\tadd.s\t$f" << contxt.Regs+1 << ",$f" << contxt.Regs+1 << ",$f" << contxt.Regs+2;
			contxt.regType[contxt.Regs+1]='f';
		}
		else{
			if(contxt.Variables[contxt.good_i].scope=="global")
			{
				load_globals(contxt, f, index);
			}
			else 
			{
				load_locals(contxt, f, index);
			
			}		
			f << "\n\taddi\t$" << contxt.Regs+1 << ", $" << contxt.Regs+1 << ", -1 #--";
		}
		
		if(contxt.Variables[contxt.good_i].scope=="global")
		{
			store_globals(contxt, f, index);
		}
		else 
		{
			store_locals(contxt, f, index);
			
		}
		
		contxt.is_postfix=false;
	} 
	contxt.Regs--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x310(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x310(%rax)
movq -0x8(%rbp), %rax
movl 0x5b4(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x318, %rdi            # imm = 0x318
leaq 0x4f085(%rip), %rsi     # 0x64977
callq 0x9e30
testb $0x1, %al
jne 0x15900
jmp 0x15ba8
movq -0x8(%rbp), %rax
testb $0x1, 0x5b0(%rax)
je 0x15ba8
movq -0x8(%rbp), %rax
testb $0x1, 0x21b(%rax)
jne 0x15ba8
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x310(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
jne 0x15a94
movq -0x8(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq -0x8(%rbp), %rax
movslq 0x5b4(%rax), %rsi
callq 0xfde0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x4eaad(%rip), %rsi     # 0x6441d
callq 0x9e30
testb $0x1, %al
jne 0x1597b
jmp 0x1598d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x27c40
jmp 0x1599d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26360
movq -0x10(%rbp), %rdi
movq 0x725c8(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4eb6c(%rip), %rsi     # 0x64523
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x2, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4eaba(%rip), %rsi     # 0x64495
callq 0x8400
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x310(%rcx), %rcx
movb $0x66, 0x341(%rax,%rcx)
movq -0x10(%rbp), %rdi
movq 0x7256e(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4ebdc(%rip), %rsi     # 0x645ed
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4eaff(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4eadb(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x2, %esi
callq 0x8730
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x310(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb $0x66, 0x341(%rax,%rcx)
jmp 0x15b42
movq -0x8(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq -0x8(%rbp), %rax
movslq 0x5b4(%rax), %rsi
callq 0xfde0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x4e960(%rip), %rsi     # 0x6441d
callq 0x9e30
testb $0x1, %al
jne 0x15ac8
jmp 0x15ada
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x27c40
jmp 0x15aea
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26360
movq -0x10(%rbp), %rdi
leaq 0x4ee74(%rip), %rsi     # 0x64969
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4ea37(%rip), %rsi     # 0x64550
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4ee35(%rip), %rsi     # 0x64972
callq 0x8400
movq -0x8(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq -0x8(%rbp), %rax
movslq 0x5b4(%rax), %rsi
callq 0xfde0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x4e8b2(%rip), %rsi     # 0x6441d
callq 0x9e30
testb $0x1, %al
jne 0x15b76
jmp 0x15b88
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x256b0
jmp 0x15b98
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x247d0
movq -0x8(%rbp), %rax
movb $0x0, 0x5b0(%rax)
jmp 0x15e6d
movq -0x8(%rbp), %rdi
addq $0x318, %rdi            # imm = 0x318
leaq 0x4edc6(%rip), %rsi     # 0x64980
callq 0x9e30
testb $0x1, %al
jne 0x15bc8
jmp 0x15e6b
movq -0x8(%rbp), %rax
testb $0x1, 0x5b0(%rax)
je 0x15e6b
movq -0x8(%rbp), %rax
testb $0x1, 0x21b(%rax)
jne 0x15e6b
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x310(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
jne 0x15d5c
movq -0x8(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq -0x8(%rbp), %rax
movslq 0x5b4(%rax), %rsi
callq 0xfde0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x4e7e5(%rip), %rsi     # 0x6441d
callq 0x9e30
testb $0x1, %al
jne 0x15c43
jmp 0x15c55
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x27c40
jmp 0x15c65
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26360
movq -0x10(%rbp), %rdi
movq 0x72300(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e8a4(%rip), %rsi     # 0x64523
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x2, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4ec14(%rip), %rsi     # 0x648b7
callq 0x8400
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x310(%rcx), %rcx
movb $0x66, 0x341(%rax,%rcx)
movq -0x10(%rbp), %rdi
movq 0x722a6(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e914(%rip), %rsi     # 0x645ed
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e837(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e813(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x2, %esi
callq 0x8730
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x310(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb $0x66, 0x341(%rax,%rcx)
jmp 0x15e0a
movq -0x8(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq -0x8(%rbp), %rax
movslq 0x5b4(%rax), %rsi
callq 0xfde0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x4e698(%rip), %rsi     # 0x6441d
callq 0x9e30
testb $0x1, %al
jne 0x15d90
jmp 0x15da2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x27c40
jmp 0x15db2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x26360
movq -0x10(%rbp), %rdi
leaq 0x4ebac(%rip), %rsi     # 0x64969
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e76f(%rip), %rsi     # 0x64550
callq 0x8400
movq %rax, %rdi
movq -0x8(%rbp), %rax
movl 0x310(%rax), %esi
addl $0x1, %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4eb75(%rip), %rsi     # 0x6497a
callq 0x8400
movq -0x8(%rbp), %rdi
addq $0x240, %rdi            # imm = 0x240
movq -0x8(%rbp), %rax
movslq 0x5b4(%rax), %rsi
callq 0xfde0
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x4e5ea(%rip), %rsi     # 0x6441d
callq 0x9e30
testb $0x1, %al
jne 0x15e3e
jmp 0x15e50
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x256b0
jmp 0x15e60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x247d0
movq -0x8(%rbp), %rax
movb $0x0, 0x5b0(%rax)
jmp 0x15e6d
movq -0x8(%rbp), %rax
movl 0x310(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x310(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)