// File: gioannides[P]Language_Processors/src/../include/ast/class_forward_declarations.hpp
// Function: typePromotion(int, int, std::basic_ofstream<char, std::char_traits<char>>&, Context&)
inline void typePromotion(int reg1,int reg2, std::ofstream& file,Context& contxt){
	if(contxt.regType[reg1] != 'f' && contxt.regType[reg2] != 'f' && reg2 > 1 && reg1 > 1){
		//do nothing
	}
	else if(contxt.regType[reg1] != contxt.regType[reg2] && reg2 > 1 && reg1 > 1){
		if(contxt.regType[reg1] != 'f'  && contxt.regType[reg2] == 'f'){
			file << std::endl << "\tmtc1\t$" << reg1 << ",$f" << reg1;
			file << std::endl << "\tnop" << std::endl;
			file << std::endl << "\tcvt.s.w\t$f" << reg1 << ",$f" << reg1;
			file << std::endl << "\tnop" << std::endl;
			if(contxt.regType[reg1] == 'u'){
				file << std::endl << "\tandi\t$" << reg1 << ",$" << reg1 << ",0xFF";
			}
		
		}
		else if(contxt.regType[reg1] == 'f' && contxt.regType[reg2] != 'f'){
			file << std::endl << "\tmtc1\t$" << reg2 << ",$f" << reg2;
			file << std::endl << "\tnop" << std::endl;
			file << std::endl << "\tcvt.s.w\t$f" << reg2 << ",$f" << reg2;
			file << std::endl << "\tnop" << std::endl;
			if(contxt.regType[reg1] == 'u'){
				file << std::endl << "\tandi\t$" << reg2 << ",$" << reg2 << ",0xFF";
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
je 0x16051
movq -0x18(%rbp), %rax
movslq -0x8(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
je 0x16051
cmpl $0x1, -0x8(%rbp)
jle 0x16051
cmpl $0x1, -0x4(%rbp)
jle 0x16051
jmp 0x16396
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movslq -0x8(%rbp), %rdx
movsbl 0x341(%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x16394
cmpl $0x1, -0x8(%rbp)
jle 0x16394
cmpl $0x1, -0x4(%rbp)
jle 0x16394
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
je 0x16210
movq -0x18(%rbp), %rax
movslq -0x8(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
jne 0x16210
movq -0x10(%rbp), %rdi
movq 0x71ea6(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e7a8(%rip), %rsi     # 0x64881
callq 0x8400
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e441(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x8730
movq -0x10(%rbp), %rdi
movq 0x71e62(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e294(%rip), %rsi     # 0x643b1
callq 0x8400
movq %rax, %rdi
movq 0x71e44(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x10(%rbp), %rdi
movq 0x71e34(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e793(%rip), %rsi     # 0x648de
callq 0x8400
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e3cf(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x8730
movq -0x10(%rbp), %rdi
movq 0x71df0(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e222(%rip), %rsi     # 0x643b1
callq 0x8400
movq %rax, %rdi
movq 0x71dd2(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x75, %eax
jne 0x1620b
movq -0x10(%rbp), %rdi
movq 0x71dad(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e4ae(%rip), %rsi     # 0x64680
callq 0x8400
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e304(%rip), %rsi     # 0x644f0
callq 0x8400
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e6d2(%rip), %rsi     # 0x648d8
callq 0x8400
jmp 0x16392
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
jne 0x16390
movq -0x18(%rbp), %rax
movslq -0x8(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
je 0x16390
movq -0x10(%rbp), %rdi
movq 0x71d23(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e625(%rip), %rsi     # 0x64881
callq 0x8400
movq %rax, %rdi
movl -0x8(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e2be(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movl -0x8(%rbp), %esi
callq 0x8730
movq -0x10(%rbp), %rdi
movq 0x71cdf(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e111(%rip), %rsi     # 0x643b1
callq 0x8400
movq %rax, %rdi
movq 0x71cc1(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x10(%rbp), %rdi
movq 0x71cb1(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e610(%rip), %rsi     # 0x648de
callq 0x8400
movq %rax, %rdi
movl -0x8(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e24c(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, %rdi
movl -0x8(%rbp), %esi
callq 0x8730
movq -0x10(%rbp), %rdi
movq 0x71c6d(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e09f(%rip), %rsi     # 0x643b1
callq 0x8400
movq %rax, %rdi
movq 0x71c4f(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x18(%rbp), %rax
movslq -0x4(%rbp), %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x75, %eax
jne 0x1638e
movq -0x10(%rbp), %rdi
movq 0x71c2a(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
leaq 0x4e32b(%rip), %rsi     # 0x64680
callq 0x8400
movq %rax, %rdi
movl -0x8(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e181(%rip), %rsi     # 0x644f0
callq 0x8400
movq %rax, %rdi
movl -0x8(%rbp), %esi
callq 0x8730
movq %rax, %rdi
leaq 0x4e54f(%rip), %rsi     # 0x648d8
callq 0x8400
jmp 0x16390
jmp 0x16392
jmp 0x16394
jmp 0x16396
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)