#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ alta(int **, int);
int /*<<< orphan*/ consulta(int **, int, int);
int /*<<< orphan*/ imprimirTodaLaMatriz(int **, int);
int /*<<< orphan*/ modificar(int **, int, int);
int /*<<< orphan*/ mostrarOpcionesMenu();
int /*<<< orphan*/ ordenAscendente(int **, int, int);
int /*<<< orphan*/ ordenDescendente(int **, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int control[1000][5];
  int registros = 0;
  bool salirDelMenu = false;
  int id, op, op2, columna;
  while (!salirDelMenu) {
    mostrarOpcionesMenu();
    scanf("%i", &op);
    switch (op) {
    case 1:
      alta(control, registros);
      registros++;
      break;
    case 2:
      printf("Que enfermera quieres consultar: ");
      scanf("%d", &id);
      consulta(control, registros, id);
      break;
    case 3:
      printf("Que enfermera quieres modificar: ");
      scanf("%d", &id);
      modificar(control, registros, id);
      break;
    case 4:
      printf("Reportes posibles:\n");
      printf("1.- Orden Ascendente\n");
      printf("2.- Orden Descendente\n");
      printf("3.- Todas las enfermeras\n");
      printf("Tipo de reporte elegido: ");
      scanf("%d", &op2);
      printf("\n");
      switch (op2) {
      case 1:
        printf("Reporte ascendente por indicador:\n");
        printf("1.- ID\n");
        printf("2.- Edad\n");
        printf("3.- Pacientes\n");
        printf("4.- Horario\n");
        printf("5.- Piso\n");
        printf("Indicador elegido: ");
        scanf("%d", &columna);
        printf("\n");
        if (columna > 0 && columna <= 5) {
          ordenAscendente(control, registros, columna - 1);
        } else
          printf("Opcion no valida\n");
        break;
      case 2:
        printf("Reporte descendente por indicador:\n");
        printf("1.- ID\n");
        printf("2.- Edad\n");
        printf("3.- Pacientes\n");
        printf("4.- Horario\n");
        printf("5.- Piso\n");
        printf("Indicador elegido: ");
        scanf("%d", &columna);
        printf("\n");
        if (columna > 0 && columna <= 5) {
          ordenDescendente(control, registros, columna - 1);
        } else
          printf("Opcion no valida\n");
        break;
      case 3:
        imprimirTodaLaMatriz(control, registros);
        break;
      default:
        printf("Opcion no valida\n");
      }
      break;
    case 5:
      printf("GRACIAS POR USAR NUESTRO SISTEMA\n");
      salirDelMenu = true;
      break;
    default:
      printf("Opcion no valida\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4e34(%rbp)
movl   $0x0,-0x4e38(%rbp)
cmpl   $0x0,-0x4e38(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11cf <main+0x3f>
jmp    1526 <main+0x396>
xor    %eax,%eax
call   10b0 <mostrarOpcionesMenu@plt>
lea    0xe37(%rip),%rdi
lea    -0x4e40(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x4e40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x4e50(%rbp)
sub    $0x4,%eax
ja     1515 <main+0x385>
mov    -0x4e50(%rbp),%rax
lea    0xdee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x4e30(%rbp),%rdi
mov    -0x4e34(%rbp),%esi
call   1080 <alta@plt>
mov    -0x4e34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e34(%rbp)
jmp    1521 <main+0x391>
lea    0xdcf(%rip),%rdi
call   1060 <printf@plt>
lea    0xde5(%rip),%rdi
lea    -0x4e3c(%rbp),%rsi
call   1090 <scanf@plt>
lea    -0x4e30(%rbp),%rdi
mov    -0x4e34(%rbp),%esi
mov    -0x4e3c(%rbp),%edx
call   1030 <consulta@plt>
jmp    1521 <main+0x391>
lea    0xdb8(%rip),%rdi
call   1060 <printf@plt>
lea    0xda9(%rip),%rdi
lea    -0x4e3c(%rbp),%rsi
call   1090 <scanf@plt>
lea    -0x4e30(%rbp),%rdi
mov    -0x4e34(%rbp),%esi
mov    -0x4e3c(%rbp),%edx
call   10a0 <modificar@plt>
jmp    1521 <main+0x391>
lea    0xd9e(%rip),%rdi
call   1060 <printf@plt>
lea    0xda6(%rip),%rdi
call   1060 <printf@plt>
lea    0xdb0(%rip),%rdi
call   1060 <printf@plt>
lea    0xdbb(%rip),%rdi
call   1060 <printf@plt>
lea    0xdc9(%rip),%rdi
call   1060 <printf@plt>
lea    0xd3d(%rip),%rdi
lea    -0x4e44(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xde5(%rip),%rdi
call   1060 <printf@plt>
mov    -0x4e44(%rbp),%eax
mov    %eax,-0x4e54(%rbp)
sub    $0x1,%eax
je     1356 <main+0x1c6>
jmp    132e <main+0x19e>
mov    -0x4e54(%rbp),%eax
sub    $0x2,%eax
je     1414 <main+0x284>
jmp    1342 <main+0x1b2>
mov    -0x4e54(%rbp),%eax
sub    $0x3,%eax
je     14d2 <main+0x342>
jmp    14e9 <main+0x359>
lea    0xd76(%rip),%rdi
call   1060 <printf@plt>
lea    0xd8d(%rip),%rdi
call   1060 <printf@plt>
lea    0xd89(%rip),%rdi
call   1060 <printf@plt>
lea    0xd87(%rip),%rdi
call   1060 <printf@plt>
lea    0xd8a(%rip),%rdi
call   1060 <printf@plt>
lea    0xd8b(%rip),%rdi
call   1060 <printf@plt>
lea    0xd89(%rip),%rdi
call   1060 <printf@plt>
lea    0xc88(%rip),%rdi
lea    -0x4e48(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xd30(%rip),%rdi
call   1060 <printf@plt>
cmpl   $0x0,-0x4e48(%rbp)
jle    1403 <main+0x273>
cmpl   $0x5,-0x4e48(%rbp)
jg     1403 <main+0x273>
lea    -0x4e30(%rbp),%rdi
mov    -0x4e34(%rbp),%esi
mov    -0x4e48(%rbp),%edx
sub    $0x1,%edx
call   1050 <ordenAscendente@plt>
jmp    140f <main+0x27f>
lea    0xd38(%rip),%rdi
call   1060 <printf@plt>
jmp    14f5 <main+0x365>
lea    0xd39(%rip),%rdi
call   1060 <printf@plt>
lea    0xccf(%rip),%rdi
call   1060 <printf@plt>
lea    0xccb(%rip),%rdi
call   1060 <printf@plt>
lea    0xcc9(%rip),%rdi
call   1060 <printf@plt>
lea    0xccc(%rip),%rdi
call   1060 <printf@plt>
lea    0xccd(%rip),%rdi
call   1060 <printf@plt>
lea    0xccb(%rip),%rdi
call   1060 <printf@plt>
lea    0xbca(%rip),%rdi
lea    -0x4e48(%rbp),%rsi
call   1090 <scanf@plt>
lea    0xc72(%rip),%rdi
call   1060 <printf@plt>
cmpl   $0x0,-0x4e48(%rbp)
jle    14c1 <main+0x331>
cmpl   $0x5,-0x4e48(%rbp)
jg     14c1 <main+0x331>
lea    -0x4e30(%rbp),%rdi
mov    -0x4e34(%rbp),%esi
mov    -0x4e48(%rbp),%edx
sub    $0x1,%edx
call   1070 <ordenDescendente@plt>
jmp    14cd <main+0x33d>
lea    0xc7a(%rip),%rdi
call   1060 <printf@plt>
jmp    14f5 <main+0x365>
lea    -0x4e30(%rbp),%rdi
mov    -0x4e34(%rbp),%esi
call   1040 <imprimirTodaLaMatriz@plt>
jmp    14f5 <main+0x365>
lea    0xc52(%rip),%rdi
call   1060 <printf@plt>
jmp    1521 <main+0x391>
lea    0xc77(%rip),%rdi
call   1060 <printf@plt>
movl   $0x1,-0x4e38(%rbp)
jmp    1521 <main+0x391>
lea    0xc26(%rip),%rdi
call   1060 <printf@plt>
jmp    11b6 <main+0x26>
xor    %eax,%eax
add    $0x4e60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4e38,%rsp
lea    0xe4c(%rip),%r14
lea    0xc(%rsp),%rbx
lea    0xe2c(%rip),%r13
lea    0x10(%rsp),%r12
lea    0xe59(%rip),%rbp
xor    %r15d,%r15d
jmp    11fc <main+0x4c>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xf85(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10d0 <mostrarOpcionesMenu@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11f0 <main+0x40>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    %r12,%rdi
mov    %r15d,%esi
call   10a0 <alta@plt>
add    $0x1,%r15d
jmp    11fc <main+0x4c>
lea    0xddb(%rip),%rdi
call   1080 <printf@plt>
mov    %rbp,%rdi
lea    0x4(%rsp),%rsi
call   10b0 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %r12,%rdi
mov    %r15d,%esi
call   1040 <consulta@plt>
jmp    11fc <main+0x4c>
lea    0xdd6(%rip),%rdi
call   1080 <printf@plt>
mov    %rbp,%rdi
lea    0x4(%rsp),%rsi
call   10b0 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %r12,%rdi
mov    %r15d,%esi
call   10c0 <modificar@plt>
jmp    11fc <main+0x4c>
lea    0xe1a(%rip),%rdi
call   1060 <puts@plt>
lea    0xe21(%rip),%rdi
call   1060 <puts@plt>
lea    0xe2a(%rip),%rdi
call   1060 <puts@plt>
lea    0xe34(%rip),%rdi
call   1060 <puts@plt>
lea    0xd9b(%rip),%rdi
call   1080 <printf@plt>
mov    %rbp,%rdi
lea    0x8(%rsp),%rsi
call   10b0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
cmp    $0x3,%eax
je     1386 <main+0x1d6>
cmp    $0x2,%eax
je     1396 <main+0x1e6>
cmp    $0x1,%eax
jne    11f0 <main+0x40>
lea    0xe22(%rip),%rdi
call   1060 <puts@plt>
lea    0xe38(%rip),%rdi
call   1060 <puts@plt>
lea    0xe33(%rip),%rdi
call   1060 <puts@plt>
lea    0xe30(%rip),%rdi
call   1060 <puts@plt>
lea    0xe32(%rip),%rdi
call   1060 <puts@plt>
lea    0xe32(%rip),%rdi
call   1060 <puts@plt>
lea    0xd2b(%rip),%rdi
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    %rsp,%rsi
call   10b0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%edx
add    $0xffffffff,%edx
cmp    $0x4,%edx
ja     11f0 <main+0x40>
mov    %r12,%rdi
mov    %r15d,%esi
call   1070 <ordenAscendente@plt>
jmp    11fc <main+0x4c>
mov    %r12,%rdi
mov    %r15d,%esi
call   1050 <imprimirTodaLaMatriz@plt>
jmp    11fc <main+0x4c>
lea    0xd67(%rip),%rdi
call   1060 <puts@plt>
lea    0xda0(%rip),%rdi
call   1060 <puts@plt>
lea    0xd9b(%rip),%rdi
call   1060 <puts@plt>
lea    0xd98(%rip),%rdi
call   1060 <puts@plt>
lea    0xd9a(%rip),%rdi
call   1060 <puts@plt>
lea    0xd9a(%rip),%rdi
call   1060 <puts@plt>
lea    0xc93(%rip),%rdi
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    %rsp,%rsi
call   10b0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%edx
add    $0xffffffff,%edx
cmp    $0x4,%edx
ja     11f0 <main+0x40>
mov    %r12,%rdi
mov    %r15d,%esi
call   1090 <ordenDescendente@plt>
jmp    11fc <main+0x4c>
lea    0xc67(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
add    $0x4e38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [34 x i8] c"Que enfermera quieres consultar: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [34 x i8] c"Que enfermera quieres modificar: \00"
@.str.4 = [20 x i8] c"Reportes posibles:\0A\00"
@.str.5 = [22 x i8] c"1.- Orden Ascendente\0A\00"
@.str.6 = [23 x i8] c"2.- Orden Descendente\0A\00"
@.str.7 = [26 x i8] c"3.- Todas las enfermeras\0A\00"
@.str.8 = [26 x i8] c"Tipo de reporte elegido: \00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [35 x i8] c"Reporte ascendente por indicador:\0A\00"
@.str.11 = [8 x i8] c"1.- ID\0A\00"
@.str.12 = [10 x i8] c"2.- Edad\0A\00"
@.str.13 = [15 x i8] c"3.- Pacientes\0A\00"
@.str.14 = [13 x i8] c"4.- Horario\0A\00"
@.str.15 = [10 x i8] c"5.- Piso\0A\00"
@.str.16 = [20 x i8] c"Indicador elegido: \00"
@.str.17 = [18 x i8] c"Opcion no valida\0A\00"
@.str.18 = [36 x i8] c"Reporte descendente por indicador:\0A\00"
@.str.19 = [34 x i8] c"GRACIAS POR USAR NUESTRO SISTEMA\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x [5 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %111, %0
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %112
13: ; preds = %9
%14 = call i32 (...) @mostrarOpcionesMenu()
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%16 = load i32, i32* %6
switch i32 %16, label %109 [
i32 1, label %17
i32 2, label %24
i32 3, label %32
i32 4, label %40
i32 5, label %107
]
17: ; preds = %13
%18 = getelementptr inbounds [1000 x [5 x i32]], [1000 x [5 x i32]]* %2, i64 0, i64 0
%19 = bitcast [5 x i32]* %18 to i32**
%20 = load i32, i32* %3
%21 = call i32 @alta(i32** %19, i32 %20)
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %111
24: ; preds = %13
%25 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%27 = getelementptr inbounds [1000 x [5 x i32]], [1000 x [5 x i32]]* %2, i64 0, i64 0
%28 = bitcast [5 x i32]* %27 to i32**
%29 = load i32, i32* %3
%30 = load i32, i32* %5
%31 = call i32 @consulta(i32** %28, i32 %29, i32 %30)
br label %111
32: ; preds = %13
%33 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%35 = getelementptr inbounds [1000 x [5 x i32]], [1000 x [5 x i32]]* %2, i64 0, i64 0
%36 = bitcast [5 x i32]* %35 to i32**
%37 = load i32, i32* %3
%38 = load i32, i32* %5
%39 = call i32 @modificar(i32** %36, i32 %37, i32 %38)
br label %111
40: ; preds = %13
%41 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%43 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%44 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%45 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%47 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%48 = load i32, i32* %7
switch i32 %48, label %104 [
i32 1, label %49
i32 2, label %74
i32 3, label %99
]
49: ; preds = %40
%50 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
%51 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%52 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%53 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%54 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%55 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%56 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%57 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%58 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%59 = load i32, i32* %8
%60 = icmp sgt i32 %59, 0
br i1 %60, label %61, label %71
61: ; preds = %49
%62 = load i32, i32* %8
%63 = icmp sle i32 %62, 5
br i1 %63, label %64, label %71
64: ; preds = %61
%65 = getelementptr inbounds [1000 x [5 x i32]], [1000 x [5 x i32]]* %2, i64 0, i64 0
%66 = bitcast [5 x i32]* %65 to i32**
%67 = load i32, i32* %3
%68 = load i32, i32* %8
%69 = sub nsw i32 %68, 1
%70 = call i32 @ordenAscendente(i32** %66, i32 %67, i32 %69)
br label %73
71: ; preds = %61, %49
%72 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %73
73: ; preds = %71, %64
br label %106
74: ; preds = %40
%75 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.18, i64 0, i64 0))
%76 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%77 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%78 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0))
%79 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0))
%80 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%81 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%82 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%83 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%84 = load i32, i32* %8
%85 = icmp sgt i32 %84, 0
br i1 %85, label %86, label %96
86: ; preds = %74
%87 = load i32, i32* %8
%88 = icmp sle i32 %87, 5
br i1 %88, label %89, label %96
89: ; preds = %86
%90 = getelementptr inbounds [1000 x [5 x i32]], [1000 x [5 x i32]]* %2, i64 0, i64 0
%91 = bitcast [5 x i32]* %90 to i32**
%92 = load i32, i32* %3
%93 = load i32, i32* %8
%94 = sub nsw i32 %93, 1
%95 = call i32 @ordenDescendente(i32** %91, i32 %92, i32 %94)
br label %98
96: ; preds = %86, %74
%97 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %98
98: ; preds = %96, %89
br label %106
99: ; preds = %40
%100 = getelementptr inbounds [1000 x [5 x i32]], [1000 x [5 x i32]]* %2, i64 0, i64 0
%101 = bitcast [5 x i32]* %100 to i32**
%102 = load i32, i32* %3
%103 = call i32 @imprimirTodaLaMatriz(i32** %101, i32 %102)
br label %106
104: ; preds = %40
%105 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %106
106: ; preds = %104, %99, %98, %73
br label %111
107: ; preds = %13
%108 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0))
store i32 1, i32* %4
br label %111
109: ; preds = %13
%110 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0))
br label %111
111: ; preds = %109, %107, %106, %32, %24, %17
br label %9
112: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [34 x i8] c"Que enfermera quieres consultar: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [34 x i8] c"Que enfermera quieres modificar: \00"
@.str.8 = [26 x i8] c"Tipo de reporte elegido: \00"
@.str.16 = [20 x i8] c"Indicador elegido: \00"
@str = [33 x i8] c"GRACIAS POR USAR NUESTRO SISTEMA\00"
@str.20 = [19 x i8] c"Reportes posibles:\00"
@str.21 = [21 x i8] c"1.- Orden Ascendente\00"
@str.22 = [22 x i8] c"2.- Orden Descendente\00"
@str.23 = [25 x i8] c"3.- Todas las enfermeras\00"
@str.24 = [35 x i8] c"Reporte descendente por indicador:\00"
@str.31 = [34 x i8] c"Reporte ascendente por indicador:\00"
@str.32 = [7 x i8] c"1.- ID\00"
@str.33 = [9 x i8] c"2.- Edad\00"
@str.34 = [14 x i8] c"3.- Pacientes\00"
@str.35 = [12 x i8] c"4.- Horario\00"
@str.36 = [9 x i8] c"5.- Piso\00"
@str.39 = [17 x i8] c"Opcion no valida\00"
define i32 @main() {
%1 = alloca [1000 x [5 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [1000 x [5 x i32]]* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast [1000 x [5 x i32]]* %1 to i32**
br label %12
12: ; preds = %75, %0
%13 = phi i32 [ 0, %0 ], [ %76, %75 ]
%14 = call i32 (...) @mostrarOpcionesMenu()
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %3
switch i32 %16, label %79 [
i32 1, label %17
i32 2, label %20
i32 3, label %25
i32 4, label %30
i32 5, label %81
]
17: ; preds = %12
%18 = call i32 @alta(i32** %11, i32 %13)
%19 = add nsw i32 %13, 1
br label %75
20: ; preds = %12
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%23 = load i32, i32* %2
%24 = call i32 @consulta(i32** %11, i32 %13, i32 %23)
br label %75
25: ; preds = %12
%26 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%28 = load i32, i32* %2
%29 = call i32 @modificar(i32** %11, i32 %13, i32 %28)
br label %75
30: ; preds = %12
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.20, i64 0, i64 0))
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.21, i64 0, i64 0))
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.22, i64 0, i64 0))
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.23, i64 0, i64 0))
%35 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%37 = call i32 @putchar(i32 10)
%38 = load i32, i32* %4
switch i32 %38, label %77 [
i32 1, label %39
i32 2, label %56
i32 3, label %73
]
39: ; preds = %30
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.31, i64 0, i64 0))
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.32, i64 0, i64 0))
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.33, i64 0, i64 0))
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.35, i64 0, i64 0))
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.36, i64 0, i64 0))
%46 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%48 = call i32 @putchar(i32 10)
%49 = load i32, i32* %5
%50 = add i32 %49, -1
%51 = icmp ult i32 %50, 5
br i1 %51, label %52, label %54
52: ; preds = %39
%53 = call i32 @ordenAscendente(i32** %11, i32 %13, i32 %50)
br label %75
54: ; preds = %39
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.39, i64 0, i64 0))
br label %75
56: ; preds = %30
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.24, i64 0, i64 0))
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.32, i64 0, i64 0))
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.33, i64 0, i64 0))
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.35, i64 0, i64 0))
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.36, i64 0, i64 0))
%63 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%64 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%65 = call i32 @putchar(i32 10)
%66 = load i32, i32* %5
%67 = add i32 %66, -1
%68 = icmp ult i32 %67, 5
br i1 %68, label %69, label %71
69: ; preds = %56
%70 = call i32 @ordenDescendente(i32** %11, i32 %13, i32 %67)
br label %75
71: ; preds = %56
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.39, i64 0, i64 0))
br label %75
73: ; preds = %30
%74 = call i32 @imprimirTodaLaMatriz(i32** %11, i32 %13)
br label %75
75: ; preds = %73, %77, %54, %52, %71, %69, %79, %25, %20, %17
%76 = phi i32 [ %13, %79 ], [ %13, %77 ], [ %13, %73 ], [ %13, %69 ], [ %13, %71 ], [ %13, %52 ], [ %13, %54 ], [ %13, %25 ], [ %13, %20 ], [ %19, %17 ]
br label %12
77: ; preds = %30
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.39, i64 0, i64 0))
br label %75
79: ; preds = %12
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.39, i64 0, i64 0))
br label %75
81: ; preds = %12
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}