#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int validar(int, int);
void cargar(void) {
  int app = 1;
  int flag = 0;
  printf("\nElija una aplicacion:\n");
  printf("\t 1.  Amazon\t 15MB\n");
  printf("\t 2.  Facebook\t 35MB\n");
  printf("\t 3.  Twitter\t 25MB\n");
  printf("\t 4.  Instagram\t 50MB\n");
  printf("\t 5.  Mail\t 25MB\n");
  printf("\t 6.  Browser\t 75MB\n");
  printf("\t 7.  Whataspp\t 50MB\n");
  printf("\t 8.  Waze\t 150MB\n");
  printf("\t 9.  Music\t 50MB\n");
  printf("\t 10. Camera\t 100MB\n");
  printf("\n\n Introduzca su opcion (si no es valido vuelve al menu): ");
  scanf("%d", &app);
  if (app == 1) {
    flag = validar(15, app);
    if (flag == 0) {
      printf("\nAbristes Amazon.\n");
    } else {
      printf("\nAmazon ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 2) {
    flag = validar(35, app);
    if (flag == 0) {
      printf("\nAbristes Facebook.\n");
    } else {
      printf("\nFacebook ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 3) {
    flag = validar(25, app);
    if (flag == 0) {
      printf("\nAbristes Twitter.\n");
    } else {
      printf("\nTwitter ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 4) {
    flag = validar(50, app);
    if (flag == 0) {
      printf("\nAbristes Instagram.\n");
    } else {
      printf("\nInstagram ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 5) {
    flag = validar(25, app);
    if (flag == 0) {
      printf("\nAbristes Mail.\n");
    } else {
      printf("\nMail ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 6) {
    flag = validar(75, app);
    if (flag == 0) {
      printf("\nAbristes Browser.\n");
    } else {
      printf("\nBrowser ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 7) {
    flag = validar(50, app);
    if (flag == 0) {
      printf("\nAbristes Whatsapp.\n");
    } else {
      printf("\nWhatsapp ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 8) {
    flag = validar(150, app);
    if (flag == 0) {
      printf("\nAbristes Waze.\n");
    } else {
      printf("\nWaze ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 9) {
    flag = validar(50, app);
    if (flag == 0) {
      printf("\nAbristes Music.\n");
    } else {
      printf("\nMusic ya esta abierto. Intente otra aplicacion.\n");
    }
  } else if (app == 10) {
    flag = validar(100, app);
    if (flag == 0) {
      printf("\nAbristes Camera.\n");
    } else {
      printf("\nCamera ya esta abierto. Intente otra aplicacion.\n");
    }
  } else {
    printf("\nVa a volver al menu principal.\n");
  }
}


x86 assembly (clang, -O0):
<cargar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
call   1040 <printf@plt>
lea    0xefe(%rip),%rdi
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0c(%rip),%rdi
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
call   1040 <printf@plt>
lea    0xf44(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jne    122c <cargar+0xfc>
mov    -0x4(%rbp),%esi
mov    $0xf,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    121b <cargar+0xeb>
lea    0xf13(%rip),%rdi
call   1040 <printf@plt>
jmp    1227 <cargar+0xf7>
lea    0xf15(%rip),%rdi
call   1040 <printf@plt>
jmp    14db <cargar+0x3ab>
cmpl   $0x2,-0x4(%rbp)
jne    1272 <cargar+0x142>
mov    -0x4(%rbp),%esi
mov    $0x23,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1261 <cargar+0x131>
lea    0xf13(%rip),%rdi
call   1040 <printf@plt>
jmp    126d <cargar+0x13d>
lea    0xf17(%rip),%rdi
call   1040 <printf@plt>
jmp    14d6 <cargar+0x3a6>
cmpl   $0x3,-0x4(%rbp)
jne    12b8 <cargar+0x188>
mov    -0x4(%rbp),%esi
mov    $0x19,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    12a7 <cargar+0x177>
lea    0xf17(%rip),%rdi
call   1040 <printf@plt>
jmp    12b3 <cargar+0x183>
lea    0xf1a(%rip),%rdi
call   1040 <printf@plt>
jmp    14d1 <cargar+0x3a1>
cmpl   $0x4,-0x4(%rbp)
jne    12fe <cargar+0x1ce>
mov    -0x4(%rbp),%esi
mov    $0x32,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    12ed <cargar+0x1bd>
lea    0xf19(%rip),%rdi
call   1040 <printf@plt>
jmp    12f9 <cargar+0x1c9>
lea    0xf1e(%rip),%rdi
call   1040 <printf@plt>
jmp    14cc <cargar+0x39c>
cmpl   $0x5,-0x4(%rbp)
jne    1344 <cargar+0x214>
mov    -0x4(%rbp),%esi
mov    $0x19,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1333 <cargar+0x203>
lea    0xf1f(%rip),%rdi
call   1040 <printf@plt>
jmp    133f <cargar+0x20f>
lea    0xf1f(%rip),%rdi
call   1040 <printf@plt>
jmp    14c7 <cargar+0x397>
cmpl   $0x6,-0x4(%rbp)
jne    138a <cargar+0x25a>
mov    -0x4(%rbp),%esi
mov    $0x4b,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1379 <cargar+0x249>
lea    0xf1b(%rip),%rdi
call   1040 <printf@plt>
jmp    1385 <cargar+0x255>
lea    0xf1e(%rip),%rdi
call   1040 <printf@plt>
jmp    14c2 <cargar+0x392>
cmpl   $0x7,-0x4(%rbp)
jne    13d0 <cargar+0x2a0>
mov    -0x4(%rbp),%esi
mov    $0x32,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    13bf <cargar+0x28f>
lea    0xf1d(%rip),%rdi
call   1040 <printf@plt>
jmp    13cb <cargar+0x29b>
lea    0xf21(%rip),%rdi
call   1040 <printf@plt>
jmp    14bd <cargar+0x38d>
cmpl   $0x8,-0x4(%rbp)
jne    1416 <cargar+0x2e6>
mov    -0x4(%rbp),%esi
mov    $0x96,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1405 <cargar+0x2d5>
lea    0xf21(%rip),%rdi
call   1040 <printf@plt>
jmp    1411 <cargar+0x2e1>
lea    0xf21(%rip),%rdi
call   1040 <printf@plt>
jmp    14b8 <cargar+0x388>
cmpl   $0x9,-0x4(%rbp)
jne    145c <cargar+0x32c>
mov    -0x4(%rbp),%esi
mov    $0x32,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    144b <cargar+0x31b>
lea    0xf1d(%rip),%rdi
call   1040 <printf@plt>
jmp    1457 <cargar+0x327>
lea    0xf1e(%rip),%rdi
call   1040 <printf@plt>
jmp    14b3 <cargar+0x383>
cmpl   $0xa,-0x4(%rbp)
jne    14a2 <cargar+0x372>
mov    -0x4(%rbp),%esi
mov    $0x64,%edi
call   1030 <validar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1491 <cargar+0x361>
lea    0xf1b(%rip),%rdi
call   1040 <printf@plt>
jmp    149d <cargar+0x36d>
lea    0xf1d(%rip),%rdi
call   1040 <printf@plt>
jmp    14ae <cargar+0x37e>
lea    0xf3f(%rip),%rdi
call   1040 <printf@plt>
jmp    14b3 <cargar+0x383>
jmp    14b8 <cargar+0x388>
jmp    14bd <cargar+0x38d>
jmp    14c2 <cargar+0x392>
jmp    14c7 <cargar+0x397>
jmp    14cc <cargar+0x39c>
jmp    14d1 <cargar+0x3a1>
jmp    14d6 <cargar+0x3a6>
jmp    14db <cargar+0x3ab>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cargar>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0xf16(%rip),%rdi
call   1040 <puts@plt>
lea    0xf21(%rip),%rdi
call   1040 <puts@plt>
lea    0xf28(%rip),%rdi
call   1040 <puts@plt>
lea    0xf31(%rip),%rdi
call   1040 <puts@plt>
lea    0xf39(%rip),%rdi
call   1040 <puts@plt>
lea    0xf43(%rip),%rdi
call   1040 <puts@plt>
lea    0xf48(%rip),%rdi
call   1040 <puts@plt>
lea    0xf50(%rip),%rdi
call   1040 <puts@plt>
lea    0xf59(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5f(%rip),%rdi
call   1040 <puts@plt>
lea    0xf65(%rip),%rdi
call   1040 <puts@plt>
lea    0xe54(%rip),%rdi
call   1050 <printf@plt>
lea    0xe83(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x9,%eax
ja     122a <cargar+0xea>
lea    0xe03(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xf,%edi
mov    $0x1,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0x11e1(%rip),%rax
lea    0x11a8(%rip),%rdi
jmp    136c <cargar+0x22c>
lea    0xf10(%rip),%rdi
jmp    1370 <cargar+0x230>
mov    $0x23,%edi
mov    $0x2,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0x116b(%rip),%rax
lea    0x1130(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x19,%edi
mov    $0x3,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0x1100(%rip),%rax
lea    0x10c6(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x32,%edi
mov    $0x4,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0x1094(%rip),%rax
lea    0x1058(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x19,%edi
mov    $0x5,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0x102b(%rip),%rax
lea    0xff4(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x4b,%edi
mov    $0x6,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0xfc4(%rip),%rax
lea    0xf8a(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x32,%edi
mov    $0x7,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0xf59(%rip),%rax
lea    0xf1e(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x96,%edi
mov    $0x8,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0xef4(%rip),%rax
lea    0xebd(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x64,%edi
mov    $0xa,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0xe4f(%rip),%rax
lea    0xe16(%rip),%rdi
jmp    136c <cargar+0x22c>
mov    $0x32,%edi
mov    $0x9,%esi
call   1030 <validar@plt>
test   %eax,%eax
lea    0xe71(%rip),%rax
lea    0xe39(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0AElija una aplicacion:\0A\00"
@.str.1 = [20 x i8] c"\09 1. Amazon\09 15MB\0A\00"
@.str.2 = [22 x i8] c"\09 2. Facebook\09 35MB\0A\00"
@.str.3 = [21 x i8] c"\09 3. Twitter\09 25MB\0A\00"
@.str.4 = [23 x i8] c"\09 4. Instagram\09 50MB\0A\00"
@.str.5 = [18 x i8] c"\09 5. Mail\09 25MB\0A\00"
@.str.6 = [21 x i8] c"\09 6. Browser\09 75MB\0A\00"
@.str.7 = [22 x i8] c"\09 7. Whataspp\09 50MB\0A\00"
@.str.8 = [19 x i8] c"\09 8. Waze\09 150MB\0A\00"
@.str.9 = [19 x i8] c"\09 9. Music\09 50MB\0A\00"
@.str.10 = [21 x i8] c"\09 10. Camera\09 100MB\0A\00"
@.str.11 = [59 x i8] c"\0A\0A Introduzca su opcion (si no es valido vuelve al menu): \00"
@.str.12 = [3 x i8] c"%d\00"
@.str.13 = [19 x i8] c"\0AAbristes Amazon.\0A\00"
@.str.14 = [51 x i8] c"\0AAmazon ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.15 = [21 x i8] c"\0AAbristes Facebook.\0A\00"
@.str.16 = [53 x i8] c"\0AFacebook ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.17 = [20 x i8] c"\0AAbristes Twitter.\0A\00"
@.str.18 = [52 x i8] c"\0ATwitter ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.19 = [22 x i8] c"\0AAbristes Instagram.\0A\00"
@.str.20 = [54 x i8] c"\0AInstagram ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.21 = [17 x i8] c"\0AAbristes Mail.\0A\00"
@.str.22 = [49 x i8] c"\0AMail ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.23 = [20 x i8] c"\0AAbristes Browser.\0A\00"
@.str.24 = [52 x i8] c"\0ABrowser ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.25 = [21 x i8] c"\0AAbristes Whatsapp.\0A\00"
@.str.26 = [53 x i8] c"\0AWhatsapp ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.27 = [17 x i8] c"\0AAbristes Waze.\0A\00"
@.str.28 = [49 x i8] c"\0AWaze ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.29 = [18 x i8] c"\0AAbristes Music.\0A\00"
@.str.30 = [50 x i8] c"\0AMusic ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.31 = [19 x i8] c"\0AAbristes Camera.\0A\00"
@.str.32 = [51 x i8] c"\0ACamera ya esta abierto. Intente otra aplicacion.\0A\00"
@.str.33 = [33 x i8] c"\0AVa a volver al menu principal.\0A\00"
define void @cargar() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %28
18: ; preds = %0
%19 = load i32, i32* %1
%20 = call i32 @validar(i32 15, i32 %19)
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
br label %27
25: ; preds = %18
%26 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.14, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br label %156
28: ; preds = %0
%29 = load i32, i32* %1
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i32, i32* %1
%33 = call i32 @validar(i32 35, i32 %32)
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %40
38: ; preds = %31
%39 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.16, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %155
41: ; preds = %28
%42 = load i32, i32* %1
%43 = icmp eq i32 %42, 3
br i1 %43, label %44, label %54
44: ; preds = %41
%45 = load i32, i32* %1
%46 = call i32 @validar(i32 25, i32 %45)
store i32 %46, i32* %2
%47 = load i32, i32* %2
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0))
br label %53
51: ; preds = %44
%52 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.18, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
br label %154
54: ; preds = %41
%55 = load i32, i32* %1
%56 = icmp eq i32 %55, 4
br i1 %56, label %57, label %67
57: ; preds = %54
%58 = load i32, i32* %1
%59 = call i32 @validar(i32 50, i32 %58)
store i32 %59, i32* %2
%60 = load i32, i32* %2
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.19, i64 0, i64 0))
br label %66
64: ; preds = %57
%65 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.20, i64 0, i64 0))
br label %66
66: ; preds = %64, %62
br label %153
67: ; preds = %54
%68 = load i32, i32* %1
%69 = icmp eq i32 %68, 5
br i1 %69, label %70, label %80
70: ; preds = %67
%71 = load i32, i32* %1
%72 = call i32 @validar(i32 25, i32 %71)
store i32 %72, i32* %2
%73 = load i32, i32* %2
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %70
%76 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.21, i64 0, i64 0))
br label %79
77: ; preds = %70
%78 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.22, i64 0, i64 0))
br label %79
79: ; preds = %77, %75
br label %152
80: ; preds = %67
%81 = load i32, i32* %1
%82 = icmp eq i32 %81, 6
br i1 %82, label %83, label %93
83: ; preds = %80
%84 = load i32, i32* %1
%85 = call i32 @validar(i32 75, i32 %84)
store i32 %85, i32* %2
%86 = load i32, i32* %2
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %83
%89 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0))
br label %92
90: ; preds = %83
%91 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.24, i64 0, i64 0))
br label %92
92: ; preds = %90, %88
br label %151
93: ; preds = %80
%94 = load i32, i32* %1
%95 = icmp eq i32 %94, 7
br i1 %95, label %96, label %106
96: ; preds = %93
%97 = load i32, i32* %1
%98 = call i32 @validar(i32 50, i32 %97)
store i32 %98, i32* %2
%99 = load i32, i32* %2
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %96
%102 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0))
br label %105
103: ; preds = %96
%104 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.26, i64 0, i64 0))
br label %105
105: ; preds = %103, %101
br label %150
106: ; preds = %93
%107 = load i32, i32* %1
%108 = icmp eq i32 %107, 8
br i1 %108, label %109, label %119
109: ; preds = %106
%110 = load i32, i32* %1
%111 = call i32 @validar(i32 150, i32 %110)
store i32 %111, i32* %2
%112 = load i32, i32* %2
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %116
114: ; preds = %109
%115 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.27, i64 0, i64 0))
br label %118
116: ; preds = %109
%117 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.28, i64 0, i64 0))
br label %118
118: ; preds = %116, %114
br label %149
119: ; preds = %106
%120 = load i32, i32* %1
%121 = icmp eq i32 %120, 9
br i1 %121, label %122, label %132
122: ; preds = %119
%123 = load i32, i32* %1
%124 = call i32 @validar(i32 50, i32 %123)
store i32 %124, i32* %2
%125 = load i32, i32* %2
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %129
127: ; preds = %122
%128 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.29, i64 0, i64 0))
br label %131
129: ; preds = %122
%130 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.30, i64 0, i64 0))
br label %131
131: ; preds = %129, %127
br label %148
132: ; preds = %119
%133 = load i32, i32* %1
%134 = icmp eq i32 %133, 10
br i1 %134, label %135, label %145
135: ; preds = %132
%136 = load i32, i32* %1
%137 = call i32 @validar(i32 100, i32 %136)
store i32 %137, i32* %2
%138 = load i32, i32* %2
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %142
140: ; preds = %135
%141 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.31, i64 0, i64 0))
br label %144
142: ; preds = %135
%143 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.32, i64 0, i64 0))
br label %144
144: ; preds = %142, %140
br label %147
145: ; preds = %132
%146 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.33, i64 0, i64 0))
br label %147
147: ; preds = %145, %144
br label %148
148: ; preds = %147, %131
br label %149
149: ; preds = %148, %118
br label %150
150: ; preds = %149, %105
br label %151
151: ; preds = %150, %92
br label %152
152: ; preds = %151, %79
br label %153
153: ; preds = %152, %66
br label %154
154: ; preds = %153, %53
br label %155
155: ; preds = %154, %40
br label %156
156: ; preds = %155, %27
ret void
}

LLVM IR (-O2):
@.str.11 = [59 x i8] c"\0A\0A Introduzca su opcion (si no es valido vuelve al menu): \00"
@.str.12 = [3 x i8] c"%d\00"
@str = [23 x i8] c"\0AElija una aplicacion:\00"
@str.34 = [19 x i8] c"\09 1. Amazon\09 15MB\00"
@str.35 = [21 x i8] c"\09 2. Facebook\09 35MB\00"
@str.36 = [20 x i8] c"\09 3. Twitter\09 25MB\00"
@str.37 = [22 x i8] c"\09 4. Instagram\09 50MB\00"
@str.38 = [17 x i8] c"\09 5. Mail\09 25MB\00"
@str.39 = [20 x i8] c"\09 6. Browser\09 75MB\00"
@str.40 = [21 x i8] c"\09 7. Whataspp\09 50MB\00"
@str.41 = [18 x i8] c"\09 8. Waze\09 150MB\00"
@str.42 = [18 x i8] c"\09 9. Music\09 50MB\00"
@str.43 = [20 x i8] c"\09 10. Camera\09 100MB\00"
@str.44 = [32 x i8] c"\0AVa a volver al menu principal.\00"
@str.45 = [50 x i8] c"\0ACamera ya esta abierto. Intente otra aplicacion.\00"
@str.46 = [18 x i8] c"\0AAbristes Camera.\00"
@str.47 = [49 x i8] c"\0AMusic ya esta abierto. Intente otra aplicacion.\00"
@str.48 = [17 x i8] c"\0AAbristes Music.\00"
@str.49 = [48 x i8] c"\0AWaze ya esta abierto. Intente otra aplicacion.\00"
@str.50 = [16 x i8] c"\0AAbristes Waze.\00"
@str.51 = [52 x i8] c"\0AWhatsapp ya esta abierto. Intente otra aplicacion.\00"
@str.52 = [20 x i8] c"\0AAbristes Whatsapp.\00"
@str.53 = [51 x i8] c"\0ABrowser ya esta abierto. Intente otra aplicacion.\00"
@str.54 = [19 x i8] c"\0AAbristes Browser.\00"
@str.55 = [48 x i8] c"\0AMail ya esta abierto. Intente otra aplicacion.\00"
@str.56 = [16 x i8] c"\0AAbristes Mail.\00"
@str.57 = [53 x i8] c"\0AInstagram ya esta abierto. Intente otra aplicacion.\00"
@str.58 = [21 x i8] c"\0AAbristes Instagram.\00"
@str.59 = [51 x i8] c"\0ATwitter ya esta abierto. Intente otra aplicacion.\00"
@str.60 = [19 x i8] c"\0AAbristes Twitter.\00"
@str.61 = [52 x i8] c"\0AFacebook ya esta abierto. Intente otra aplicacion.\00"
@str.62 = [20 x i8] c"\0AAbristes Facebook.\00"
@str.63 = [50 x i8] c"\0AAmazon ya esta abierto. Intente otra aplicacion.\00"
@str.64 = [18 x i8] c"\0AAbristes Amazon.\00"
define void @cargar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.34, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.35, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.36, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.37, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.38, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.39, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.40, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.41, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.42, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.43, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
switch i32 %16, label %57 [
i32 1, label %17
i32 2, label %21
i32 3, label %25
i32 4, label %29
i32 5, label %33
i32 6, label %37
i32 7, label %41
i32 8, label %45
i32 9, label %49
i32 10, label %53
]
17: ; preds = %0
%18 = call i32 @validar(i32 15, i32 1)
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.64, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @str.63, i64 0, i64 0)
br label %57
21: ; preds = %0
%22 = call i32 @validar(i32 35, i32 2)
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.62, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @str.61, i64 0, i64 0)
br label %57
25: ; preds = %0
%26 = call i32 @validar(i32 25, i32 3)
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.60, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str.59, i64 0, i64 0)
br label %57
29: ; preds = %0
%30 = call i32 @validar(i32 50, i32 4)
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.58, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @str.57, i64 0, i64 0)
br label %57
33: ; preds = %0
%34 = call i32 @validar(i32 25, i32 5)
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.56, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @str.55, i64 0, i64 0)
br label %57
37: ; preds = %0
%38 = call i32 @validar(i32 75, i32 6)
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.54, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @str.53, i64 0, i64 0)
br label %57
41: ; preds = %0
%42 = call i32 @validar(i32 50, i32 7)
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.52, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @str.51, i64 0, i64 0)
br label %57
45: ; preds = %0
%46 = call i32 @validar(i32 150, i32 8)
%47 = icmp eq i32 %46, 0
%48 = select i1 %47, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.50, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @str.49, i64 0, i64 0)
br label %57
49: ; preds = %0
%50 = call i32 @validar(i32 50, i32 9)
%51 = icmp eq i32 %50, 0
%52 = select i1 %51, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.48, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @str.47, i64 0, i64 0)
br label %57
53: ; preds = %0
%54 = call i32 @validar(i32 100, i32 10)
%55 = icmp eq i32 %54, 0
%56 = select i1 %55, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.46, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @str.45, i64 0, i64 0)
br label %57
57: ; preds = %0, %53, %49, %45, %41, %37, %33, %29, %25, %21, %17
%58 = phi i8* [ %20, %17 ], [ %24, %21 ], [ %28, %25 ], [ %32, %29 ], [ %36, %33 ], [ %40, %37 ], [ %44, %41 ], [ %48, %45 ], [ %52, %49 ], [ %56, %53 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @str.44, i64 0, i64 0), %0 ]
%59 = call i32 @puts(i8* dereferenceable(1) %58)
ret void
}