// File: gioannides[P]Language_Processors/src/../include/ast/ast_node_python.cpp
// Function: SelectionStatement::print_py(std::basic_ofstream<char, std::char_traits<char>>&, bool)
inline void SelectionStatement::print_py(std::ofstream& file,bool elseif) { 	//the elseif flag is initially set to false when the program starts for the first time
	
	if( SELECTIVE_IF != NULL && AssignmentExpressionPtr != NULL && StatementPtr != NULL && StatementPtr2 == NULL && SELECTIVE_ELSE == NULL && SELECTIVE_SWITCH == NULL) {
				
								
		if(elseif == false){						//if the elseif flag is on, then this has already been printed as elif, from below, so skip (looked ahead)
			
			for( int i(0); i<counter_py; i++) { file << "\t"; } 	// the elseif flag cannot be ON if this is the first time we execute, so the check here is fine to do
				file << "if(";					//always ident when entering a new scope
				is_Selective = true;
				AssignmentExpressionPtr->print_py(file) ;
				is_Selective = false;
				file << "):" << std::endl;
			
		}
			Indent_Generator(StatementPtr,file,elseif);
	}

	else if (SELECTIVE_IF!=NULL&&AssignmentExpressionPtr!=NULL&&StatementPtr!=NULL&&StatementPtr2!=NULL&&SELECTIVE_ELSE!=NULL&&SELECTIVE_SWITCH==NULL) {


		if(elseif == false) {						//modification of elseif variable has not been made on first entry so is ok (ie. the elseif is still 											//initialized to false)
			for( int i(0); i<counter_py; i++) { file << "\t"; } 
			file << "if(";
			is_Selective = true;
			AssignmentExpressionPtr->print_py(file) ;
			is_Selective = false;
			file << "):" << std::endl;
			Indent_Generator(StatementPtr,file,elseif);  
				
		}

		if(elseif == true) {					//If the elseif was detected from the previous iteration, then the body of it is in the next
									//therefore will be printed here
			
			 Indent_Generator(StatementPtr,file,elseif); 
			 elseif = false;
		}

		if( (StatementPtr2->SelectionStatementPtr != NULL && (StatementPtr2->SelectionStatementPtr)->SELECTIVE_IF) != NULL) { //check for else-if scenario

			elseif = true;
		}

		if(elseif == false) {
		
			for( int i(0); i<counter_py; i++) { file << "\t"; } 
			file << "else:";
			file << std::endl;
			is_Selective = true;
			Indent_Generator(StatementPtr2,file,elseif);
			is_Selective = false;
		}

		else if (elseif == true){

			for( int i(0); i<counter_py; i++) { file << "\t"; }	
			file <<"elif(";
			is_Selective = true;
	       		((StatementPtr2->SelectionStatementPtr)->AssignmentExpressionPtr)->print_py(file) ;
			elseif = true;
			is_Selective = false;
			file << "):" << std::endl;		
			StatementPtr2->print_py(file,elseif); 
					
		}				
				
				
	}
	


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, 0x20(%rax)
je 0xd1eb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xd1eb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xd1eb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0xd1eb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0xd1eb
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0xd1eb
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd1cd
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x8f5ca(%rip), %eax     # 0x9c72c
jge 0xd17f
movq -0x10(%rbp), %rdi
leaq 0x5734c(%rip), %rsi     # 0x644bb
callq 0x8400
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xd159
movq -0x10(%rbp), %rdi
leaq 0x57097(%rip), %rsi     # 0x64221
callq 0x8400
movq -0x30(%rbp), %rax
movb $0x1, 0x8f598(%rip)     # 0x9c732
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xd640
movb $0x0, 0x8f584(%rip)     # 0x9c732
movq -0x10(%rbp), %rdi
leaq 0x57019(%rip), %rsi     # 0x641d2
callq 0x8400
movq %rax, %rdi
movq 0x7ada8(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0xe3d0
jmp 0xd48e
movq -0x30(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xd48c
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xd48c
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xd48c
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xd48c
movq -0x30(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0xd48c
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0xd48c
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd2ea
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x8f4c6(%rip), %eax     # 0x9c72c
jge 0xd283
movq -0x10(%rbp), %rdi
leaq 0x57248(%rip), %rsi     # 0x644bb
callq 0x8400
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd25d
movq -0x10(%rbp), %rdi
leaq 0x56f93(%rip), %rsi     # 0x64221
callq 0x8400
movq -0x30(%rbp), %rax
movb $0x1, 0x8f494(%rip)     # 0x9c732
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xd640
movb $0x0, 0x8f480(%rip)     # 0x9c732
movq -0x10(%rbp), %rdi
leaq 0x56f15(%rip), %rsi     # 0x641d2
callq 0x8400
movq %rax, %rdi
movq 0x7aca4(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0xe3d0
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xd314
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0xe3d0
movb $0x0, -0x11(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
cmpq $0x0, 0x30(%rcx)
movb %al, -0x31(%rbp)
je 0xd33f
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x30(%rax), %rax
cmpq $0x0, 0x20(%rax)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpq $0x0, %rax
je 0xd351
movb $0x1, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd3d7
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x8f3be(%rip), %eax     # 0x9c72c
jge 0xd38b
movq -0x10(%rbp), %rdi
leaq 0x57140(%rip), %rsi     # 0x644bb
callq 0x8400
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xd365
movq -0x10(%rbp), %rdi
leaq 0x56e83(%rip), %rsi     # 0x64219
callq 0x8400
movq -0x10(%rbp), %rdi
movq 0x7abca(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x30(%rbp), %rax
movb $0x1, 0x8f37c(%rip)     # 0x9c732
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0xe3d0
movb $0x0, 0x8f360(%rip)     # 0x9c732
jmp 0xd48a
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xd488
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0x8f334(%rip), %eax     # 0x9c72c
jge 0xd415
movq -0x10(%rbp), %rdi
leaq 0x570b6(%rip), %rsi     # 0x644bb
callq 0x8400
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xd3ef
movq -0x10(%rbp), %rdi
leaq 0x56dff(%rip), %rsi     # 0x6421f
callq 0x8400
movq -0x30(%rbp), %rax
movb $0x1, 0x8f302(%rip)     # 0x9c732
movq 0x18(%rax), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xd640
movb $0x1, -0x11(%rbp)
movb $0x0, 0x8f2e2(%rip)     # 0x9c732
movq -0x10(%rbp), %rdi
leaq 0x56d77(%rip), %rsi     # 0x641d2
callq 0x8400
movq %rax, %rdi
movq 0x7ab06(%rip), %rsi     # 0x87f70
callq 0x8450
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0xcf70
jmp 0xd48a
jmp 0xd48c
jmp 0xd48e
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop