// File: gioannides[P]Language_Processors/src/../include/ast/ast_node.hpp
// Function: LabeledStatement::render_asm(std::basic_ofstream<char, std::char_traits<char>>&, Context&)
inline void LabeledStatement::render_asm(std::ofstream& file,Context& contxt) {

		
				
				

			if( LABELED_TYPE != NULL && ConstantExpressionPtr != NULL && *LABELED_TYPE == "case" && StatementPtr != NULL) {
				
				if(!contxt.ReadingSwitch){
					
					if( contxt.Cases.size() != 0 && contxt.VectorSize < contxt.Cases.size()){
						for(int i(0); i < contxt.Cases.size(); i++){

							if(contxt.Cases[i].ConstantTemp == ConstantExpressionPtr){
								file <<  std::endl << contxt.Cases[i].CaseID << ":";
								contxt.VectorSize++;
								break;
							}

						}
						
						
						StatementPtr->render_asm(file,contxt);
					}					
					
					
				}
				else if(contxt.ReadingSwitch){
					
					contxt.inCase = true;
					std::string label_id = labelGen(contxt);	
					std::string CASE = "$CASE" + label_id ;
					
						contxt.SwitchTemp.ConstantTemp = ConstantExpressionPtr;
						contxt.SwitchTemp.CaseID = CASE;

						contxt.rhs_of_expression = true;
						ConstantExpressionPtr->render_asm(file,contxt); //li in register 3
						contxt.rhs_of_expression = false;

						if(contxt.regType[contxt.Regs+1] == 'f'){					
							file << std::endl << "\tc.eq.s\t$f" << contxt.Regs << ",$f" << contxt.Regs+1;
							file << std::endl << "\tnop";
							file << std::endl << "\tbc1t\t" << CASE;
							file << std::endl << "\tnop";
						}
						else{
							file << std::endl << "\tbeq\t$" << contxt.Regs << ",$" << contxt.Regs+1 << "," << CASE;  //beq
						}
						contxt.Cases.push_back(contxt.SwitchTemp);
						file << std::endl << "\tnop";				//nop
					contxt.SwitchControl = 0;
					contxt.inCase = false;
					
					
				}
				
				
			}


			else if( LABELED_TYPE == NULL && ConstantExpressionPtr == NULL && IDENTIFIER != NULL && StatementPtr != NULL && !contxt.ReadingSwitch) {

				
				file << std::endl << *IDENTIFIER << "_" << contxt.funct_id << ":" << std::endl;
				StatementPtr->render_asm(file,contxt);
				
			}
		

			else if( LABELED_TYPE != NULL && ConstantExpressionPtr == NULL && *LABELED_TYPE == "default" && StatementPtr != NULL) {				
				
				if(!contxt.ReadingSwitch){
					
					if( contxt.Cases.size() != 0 && contxt.VectorSize < contxt.Cases.size()){
						for(int i(0); i < contxt.Cases.size(); i++){

							if(contxt.Cases[i].ConstantTemp == NULL){
								file <<  std::endl << contxt.Cases[i].CaseID << ":";
								contxt.VectorSize++;
								break;
							}

						}
						
						
						StatementPtr->render_asm(file,contxt);
					}					
					
					
				}
				else if(contxt.ReadingSwitch){
					
					contxt.inCase = true;
					std::string label_id = labelGen(contxt);	
					std::string DEFAULT = "$DEFAULT" + label_id ;
					
						contxt.SwitchTemp.ConstantTemp = NULL;
						contxt.SwitchTemp.CaseID = DEFAULT;


						file << std::endl << "\tb\t" << DEFAULT;  //beq

						contxt.Cases.push_back(contxt.SwitchTemp);
						file << std::endl << "\tnop";				//nop
					contxt.SwitchControl = 0;
					contxt.inCase = false;
					
				}
					
			}
			

		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, 0x10(%rax)
je 0x2c763
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2c763
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x38777(%rip), %rsi     # 0x649f8
callq 0x9e30
testb $0x1, %al
jne 0x2c28f
jmp 0x2c763
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2c763
movq -0x18(%rbp), %rax
testb $0x1, 0x3d1(%rax)
jne 0x2c3e9
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
callq 0x2fad0
cmpq $0x0, %rax
je 0x2c3e4
movq -0x18(%rbp), %rax
movslq 0x5ac(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
callq 0x2fad0
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2c3e4
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
callq 0x2fad0
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2c3cc
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
movslq -0x1c(%rbp), %rsi
callq 0x2fb00
movq -0xb8(%rbp), %rcx
movq (%rax), %rax
cmpq 0x18(%rcx), %rax
jne 0x2c3bc
movq -0x10(%rbp), %rdi
movq 0x5bc0b(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
movslq -0x1c(%rbp), %rsi
callq 0x2fb00
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x83c0
movq %rax, %rdi
leaq 0x37e31(%rip), %rsi     # 0x641d3
callq 0x8400
movq -0x18(%rbp), %rax
movl 0x5ac(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5ac(%rax)
jmp 0x2c3cc
jmp 0x2c3be
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2c308
movq -0xb8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2c110
jmp 0x2c75e
movq -0x18(%rbp), %rax
testb $0x1, 0x3d1(%rax)
je 0x2c75c
movq -0x18(%rbp), %rax
movl $0x1, 0x5a8(%rax)
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x11f70
movq -0xd8(%rbp), %rdx
leaq 0x385d3(%rip), %rsi     # 0x649fd
leaq -0x60(%rbp), %rdi
callq 0x12040
jmp 0x2c435
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x580(%rax)
movq -0x18(%rbp), %rdi
addq $0x588, %rdi            # imm = 0x588
leaq -0x60(%rbp), %rsi
callq 0x8060
jmp 0x2c461
movq -0xb8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x1, 0x1d1(%rcx)
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x11a20
jmp 0x2c486
movq -0x18(%rbp), %rax
movb $0x0, 0x1d1(%rax)
movq -0x18(%rbp), %rax
movq -0x18(%rbp), %rcx
movl 0x310(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl 0x341(%rax,%rcx), %eax
cmpl $0x66, %eax
jne 0x2c613
movq -0x10(%rbp), %rdi
movq 0x5baaf(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0xe0(%rbp)
jmp 0x2c4cf
movq -0xe0(%rbp), %rdi
leaq 0x37f97(%rip), %rsi     # 0x64474
callq 0x8400
movq %rax, -0xe8(%rbp)
jmp 0x2c4eb
movq -0xe8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x310(%rax), %esi
callq 0x8730
movq %rax, -0xf0(%rbp)
jmp 0x2c50a
movq -0xf0(%rbp), %rdi
leaq 0x3801c(%rip), %rsi     # 0x64534
callq 0x8400
movq %rax, -0xf8(%rbp)
jmp 0x2c526
movq -0xf8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x310(%rax), %esi
incl %esi
callq 0x8730
jmp 0x2c540
movq -0x10(%rbp), %rdi
movq 0x5ba25(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x100(%rbp)
jmp 0x2c559
movq -0x100(%rbp), %rdi
leaq 0x37e4a(%rip), %rsi     # 0x643b1
callq 0x8400
jmp 0x2c56e
movq -0x10(%rbp), %rdi
movq 0x5b9f7(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x108(%rbp)
jmp 0x2c587
movq -0x108(%rbp), %rdi
leaq 0x37f0e(%rip), %rsi     # 0x644a3
callq 0x8400
movq %rax, -0x110(%rbp)
jmp 0x2c5a3
movq -0x110(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x83c0
jmp 0x2c5b5
movq -0x10(%rbp), %rdi
movq 0x5b9b0(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x118(%rbp)
jmp 0x2c5ce
movq -0x118(%rbp), %rdi
leaq 0x37dd5(%rip), %rsi     # 0x643b1
callq 0x8400
jmp 0x2c5e3
jmp 0x2c6d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2c74e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8280
jmp 0x2c74e
movq -0x10(%rbp), %rdi
movq 0x5b952(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x120(%rbp)
jmp 0x2c62c
movq -0x120(%rbp), %rdi
leaq 0x383c9(%rip), %rsi     # 0x64a03
callq 0x8400
movq %rax, -0x128(%rbp)
jmp 0x2c648
movq -0x128(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x310(%rax), %esi
callq 0x8730
movq %rax, -0x130(%rbp)
jmp 0x2c667
movq -0x130(%rbp), %rdi
leaq 0x37e7b(%rip), %rsi     # 0x644f0
callq 0x8400
movq %rax, -0x138(%rbp)
jmp 0x2c683
movq -0x138(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x310(%rax), %esi
incl %esi
callq 0x8730
movq %rax, -0x140(%rbp)
jmp 0x2c6a4
movq -0x140(%rbp), %rdi
leaq 0x37d8b(%rip), %rsi     # 0x6443d
callq 0x8400
movq %rax, -0x148(%rbp)
jmp 0x2c6c0
movq -0x148(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x83c0
jmp 0x2c6d2
jmp 0x2c6d4
movq -0x18(%rbp), %rsi
movq %rsi, %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
addq $0x580, %rsi            # imm = 0x580
callq 0x2fb20
jmp 0x2c6f0
movq -0x10(%rbp), %rdi
movq 0x5b875(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x150(%rbp)
jmp 0x2c709
movq -0x150(%rbp), %rdi
leaq 0x37c9a(%rip), %rsi     # 0x643b1
callq 0x8400
jmp 0x2c71e
movq -0x18(%rbp), %rax
movl $0x0, 0x564(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x5a8(%rax)
leaq -0x60(%rbp), %rdi
callq 0x8280
leaq -0x40(%rbp), %rdi
callq 0x8280
jmp 0x2c75c
leaq -0x40(%rbp), %rdi
callq 0x8280
jmp 0x2cb59
jmp 0x2c75e
jmp 0x2cb50
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2c83c
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2c83c
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2c83c
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2c83c
movq -0x18(%rbp), %rax
testb $0x1, 0x3d1(%rax)
jne 0x2c83c
movq -0x10(%rbp), %rdi
movq 0x5b7a9(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, %rdi
movq -0xb8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x83c0
movq %rax, %rdi
leaq 0x38250(%rip), %rsi     # 0x64a39
callq 0x8400
movq %rax, %rdi
movq -0x18(%rbp), %rsi
addq $0x220, %rsi            # imm = 0x220
callq 0x83c0
movq %rax, %rdi
leaq 0x379c8(%rip), %rsi     # 0x641d3
callq 0x8400
movq %rax, %rdi
movq 0x5b756(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0xb8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2c110
jmp 0x2cb4e
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2cb4c
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2cb4c
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x38198(%rip), %rsi     # 0x64a0a
callq 0x9e30
testb $0x1, %al
jne 0x2c880
jmp 0x2cb4c
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2cb4c
movq -0x18(%rbp), %rax
testb $0x1, 0x3d1(%rax)
jne 0x2c9d0
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
callq 0x2fad0
cmpq $0x0, %rax
je 0x2c9cb
movq -0x18(%rbp), %rax
movslq 0x5ac(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
callq 0x2fad0
movq %rax, %rcx
movq -0x158(%rbp), %rax
cmpq %rcx, %rax
jae 0x2c9cb
movl $0x0, -0x70(%rbp)
movslq -0x70(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
callq 0x2fad0
movq %rax, %rcx
movq -0x160(%rbp), %rax
cmpq %rcx, %rax
jae 0x2c9b3
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
movslq -0x70(%rbp), %rsi
callq 0x2fb00
cmpq $0x0, (%rax)
jne 0x2c9a3
movq -0x10(%rbp), %rdi
movq 0x5b624(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x168(%rbp)
movq -0x18(%rbp), %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
movslq -0x70(%rbp), %rsi
callq 0x2fb00
movq -0x168(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x83c0
movq %rax, %rdi
leaq 0x3784a(%rip), %rsi     # 0x641d3
callq 0x8400
movq -0x18(%rbp), %rax
movl 0x5ac(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5ac(%rax)
jmp 0x2c9b3
jmp 0x2c9a5
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x2c8f9
movq -0xb8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2c110
jmp 0x2cb4a
movq -0x18(%rbp), %rax
testb $0x1, 0x3d1(%rax)
je 0x2cb48
movq -0x18(%rbp), %rax
movl $0x1, 0x5a8(%rax)
movq -0x18(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x11f70
movq -0x170(%rbp), %rdx
leaq 0x37ffe(%rip), %rsi     # 0x64a12
leaq -0xb0(%rbp), %rdi
callq 0x12040
jmp 0x2ca22
movq -0x18(%rbp), %rax
movq $0x0, 0x580(%rax)
movq -0x18(%rbp), %rdi
addq $0x588, %rdi            # imm = 0x588
leaq -0xb0(%rbp), %rsi
callq 0x8060
jmp 0x2ca4a
movq -0x10(%rbp), %rdi
movq 0x5b51b(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x178(%rbp)
jmp 0x2ca63
movq -0x178(%rbp), %rdi
leaq 0x37a20(%rip), %rsi     # 0x64491
callq 0x8400
movq %rax, -0x180(%rbp)
jmp 0x2ca7f
movq -0x180(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x83c0
jmp 0x2ca94
movq -0x18(%rbp), %rsi
movq %rsi, %rdi
addq $0x3b8, %rdi            # imm = 0x3B8
addq $0x580, %rsi            # imm = 0x580
callq 0x2fb20
jmp 0x2cab0
movq -0x10(%rbp), %rdi
movq 0x5b4b5(%rip), %rsi     # 0x87f70
callq 0x8450
movq %rax, -0x188(%rbp)
jmp 0x2cac9
movq -0x188(%rbp), %rdi
leaq 0x378da(%rip), %rsi     # 0x643b1
callq 0x8400
jmp 0x2cade
movq -0x18(%rbp), %rax
movl $0x0, 0x564(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x5a8(%rax)
leaq -0xb0(%rbp), %rdi
callq 0x8280
leaq -0x90(%rbp), %rdi
callq 0x8280
jmp 0x2cb48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x2cb3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x8280
leaq -0x90(%rbp), %rdi
callq 0x8280
jmp 0x2cb59
jmp 0x2cb4a
jmp 0x2cb4c
jmp 0x2cb4e
jmp 0x2cb50
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x8760
nopw %cs:(%rax,%rax)
nopl (%rax)