// File: /workspace/github_cpp_makefile_star2_O1/DaCasBe[P]Gestion-de-asignaturas-mediante-listas-doblemente-enlazadas-ordenadas/principalAsignatura.cpp
// Function: main
int main(){

	ed::Asignatura asignatura;

	int opcion;

	do{

		// Se elige la opción del menún
		opcion = ed::menu();		

		std::cout << CLEAR_SCREEN;
		LUGAR(5,1);

		// Se ejecuta la opción del menú elegida
		switch(opcion)
		{
			case 0: 
				std::cout << INVERSE;
				std::cout << "Fin del programa" << std::endl;
				std::cout << RESET;
			break;

			case 1: 
					std::cout << "[1] Comprobar si la asignatura está vacía" << std::endl;
					ed::comprobarAsignaturaVacia(asignatura);
					break;

			case 2: 
				  std::cout << "[2] Cargar la asignatura de un fichero" << std::endl;
					ed::cargarAsignatura(asignatura);
				break;

			case 3: 
				  std::cout << "[3] Grabar la asignatura en un fichero" << std::endl;
					ed::grabarAsignatura(asignatura);
					break;

			case 4: 
			  	std::cout << "[4] Consultar datos de la asignatura: " << std::endl; 
					ed::consultarAsignatura(asignatura);
					break;

			case 5: 
					std::cout << "[5] Modificar datos de la asignatura: código o nombre" << std::endl;
				  ed::modificarAsignatura(asignatura);
					break;

			case 6: 
					std::cout << "[6] Borrar una asignatura" << std::endl;
				  ed::borrarAsignatura(asignatura);
					break;


			case 7: 
					std::cout << "[7] Consultar un estudiante" << std::endl;
			    consultarEstudianteDeAsignatura(asignatura);
					break;

			case 8: 
					std::cout << "[8] Insertar un estudiante" << std::endl;
				  insertarEstudianteEnAsignatura(asignatura);
					break;

			case 9: 
					std::cout << "[9] Modificar un estudiante" << std::endl;
				  modificarEstudianteDeAsignatura(asignatura);
					break;

			case 10: 
					std::cout << "[10] Borrar un estudiante" << std::endl;
					borrarEstudianteDeAsignatura(asignatura);
					break;

			default:
			    LUGAR(25,25);
					std::cout << INVERSE;
					std::cout << "Opción incorrecta ";
					std::cout << RESET;
			  	std::cout << RED;
					std::cout << " --> " << opcion << std::endl;
					std::cout << RESET;
     }
  
    if (opcion !=0)
    {
		 LUGAR(30,25);
		 std::cout << "pulse ";
		 std::cout << UNDERLINE;
		 std::cout << IYELLOW;
		 std::cout << "ENTER";
		 std::cout << RESET;
		 std::cout << " para ";
		 std::cout << INVERSE;
		 std::cout << "continuar"; 
		 std::cout << RESET;
		 getchar();
		 std::cout << CLEAR_SCREEN;
    }
	  }while(opcion!=0);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1985(%rip), %rdx      # 0x8d29
leaq -0x90(%rbp), %rdi
movq %rdx, %rsi
callq 0x396c
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
xorl %esi, %esi
callq 0x797a
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x73d6
callq 0x2130
movq 0x4bf3(%rip), %r14      # 0xbfd0
leaq 0x1909(%rip), %r15      # 0x8ced
leaq 0xc3b(%rip), %r13       # 0x8026
callq 0x4710
movl %eax, %r12d
movl $0x4, %edx
movq %r14, %rdi
leaq 0x18e6(%rip), %rsi      # 0x8ce8
callq 0x2180
movq %r15, %rdi
movl $0x5, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x2050
cmpl $0xa, %r12d
ja 0x7756
movl %r12d, %eax
leaq 0x2001(%rip), %rcx      # 0x9430
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x4, %edx
movq %r14, %rdi
leaq 0x2015(%rip), %rsi      # 0x945c
callq 0x2180
movl $0x10, %edx
movq %r14, %rdi
leaq 0x2006(%rip), %rsi      # 0x9461
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movq %r14, %rbx
jmp 0x77ec
movl $0x26, %edx
movq %r14, %rdi
leaq 0x1fe7(%rip), %rsi      # 0x9472
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x4fe4
jmp 0x780f
movl $0x1b, %edx
movq %r14, %rdi
leaq 0x19a4(%rip), %rsi      # 0x8e78
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x6274
jmp 0x780f
movl $0x26, %edx
movq %r14, %rdi
leaq 0x1839(%rip), %rsi      # 0x8d56
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x4aca
jmp 0x780f
movl $0x26, %edx
movq %r14, %rdi
leaq 0x1817(%rip), %rsi      # 0x8d7d
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x4dbe
jmp 0x780f
movl $0x1b, %edx
movq %r14, %rdi
leaq 0x1892(%rip), %rsi      # 0x8e41
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x58d1
jmp 0x780f
movl $0x2b, %edx
movq %r14, %rdi
leaq 0x1732(%rip), %rsi      # 0x8d2a
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x49d3
jmp 0x780f
movl $0x36, %edx
movq %r14, %rdi
leaq 0x17af(%rip), %rsi      # 0x8df0
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x537c
jmp 0x780f
movl $0x19, %edx
movq %r14, %rdi
leaq 0x179d(%rip), %rsi      # 0x8e27
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x4c6e
jmp 0x780f
movl $0x19, %edx
movq %r14, %rdi
leaq 0x17c1(%rip), %rsi      # 0x8e94
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x6e36
jmp 0x780f
movl $0x1a, %edx
movq %r14, %rdi
leaq 0x1741(%rip), %rsi      # 0x8e5d
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x5f8c
jmp 0x780f
movq %r15, %rdi
movl $0x19, %esi
movl $0x19, %edx
xorl %eax, %eax
callq 0x2050
movl $0x4, %edx
movq %r14, %rdi
leaq 0x1ce3(%rip), %rsi      # 0x945c
callq 0x2180
movl $0x13, %edx
movq %r14, %rdi
leaq 0x1d0c(%rip), %rsi      # 0x9499
callq 0x2180
movl $0x4, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2180
movl $0x7, %edx
movq %r14, %rdi
leaq 0x1933(%rip), %rsi      # 0x90e4
callq 0x2180
movl $0x5, %edx
movq %r14, %rdi
leaq 0x1ce8(%rip), %rsi      # 0x94ad
callq 0x2180
movq %r14, %rdi
movl %r12d, %esi
callq 0x2210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x4, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2180
testl %r12d, %r12d
je 0x78f6
movq %r15, %rdi
movl $0x1e, %esi
movl $0x19, %edx
xorl %eax, %eax
callq 0x2050
movl $0x6, %edx
movq %r14, %rdi
leaq 0x1c78(%rip), %rsi      # 0x94b3
callq 0x2180
movl $0x4, %edx
movq %r14, %rdi
leaq 0x1c6b(%rip), %rsi      # 0x94ba
callq 0x2180
movl $0x7, %edx
movq %r14, %rdi
leaq 0x822(%rip), %rsi       # 0x8085
callq 0x2180
movl $0x5, %edx
movq %r14, %rdi
leaq 0x1c48(%rip), %rsi      # 0x94bf
callq 0x2180
movl $0x4, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2180
movl $0x6, %edx
movq %r14, %rdi
leaq 0x1c2a(%rip), %rsi      # 0x94c5
callq 0x2180
movl $0x4, %edx
movq %r14, %rdi
leaq 0x1bad(%rip), %rsi      # 0x945c
callq 0x2180
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1c09(%rip), %rsi      # 0x94cc
callq 0x2180
movl $0x4, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2180
callq 0x21a0
movl $0x4, %edx
movq %r14, %rdi
leaq 0x13fc(%rip), %rsi      # 0x8ce8
callq 0x2180
jmp 0x73eb
leaq 0x4423(%rip), %rax      # 0xbd20
addq $0x10, %rax
leaq -0x40(%rbp), %rdi
movq %rax, -0x30(%rdi)
callq 0x7aa8
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7920
callq 0x2130
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x7952
jmp 0x796a
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x796a
callq 0x2130
jmp 0x796a
movq %rax, %rbx
jmp 0x796a
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x7a4e
movq %rbx, %rdi
callq 0x2220
movq %rax, %rdi
callq 0x3694